• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 19015773527

02 Nov 2025 05:33PM UTC coverage: 17.872% (-62.4%) from 80.3%
19015773527

Pull #22816

github

web-flow
Merge a12d75757 into 6c024e162
Pull Request #22816: Update Pants internal Python to 3.14

4 of 5 new or added lines in 3 files covered. (80.0%)

28452 existing lines in 683 files now uncovered.

9831 of 55007 relevant lines covered (17.87%)

0.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/core/util_rules/unowned_dependency_behavior.py
1
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
UNCOV
3
from __future__ import annotations
×
4

UNCOV
5
from enum import Enum
×
6

UNCOV
7
from pants.option.option_types import EnumOption
×
UNCOV
8
from pants.util.strutil import softwrap
×
9

10

UNCOV
11
class UnownedDependencyUsage(Enum):
×
12
    """What action to take when an inferred dependency is unowned."""
13

UNCOV
14
    RaiseError = "error"
×
UNCOV
15
    LogWarning = "warning"
×
UNCOV
16
    DoNothing = "ignore"
×
17

18

UNCOV
19
class UnownedDependencyUsageOption(EnumOption[UnownedDependencyUsage, UnownedDependencyUsage]):
×
UNCOV
20
    def __new__(cls, example_runtime_issue: str, how_to_ignore: str):
×
UNCOV
21
        return super().__new__(
×
22
            cls,
23
            default=UnownedDependencyUsage.LogWarning,
24
            help=softwrap(
25
                f"""
26
                How to handle imports that don't have an inferable owner.
27

28
                Usually when an import cannot be inferred, it represents an issue like Pants not being
29
                properly configured, e.g. targets not set up. Often, missing dependencies will result
30
                in confusing runtime errors like {example_runtime_issue}, so this option can be helpful
31
                to error more eagerly.
32

33
                To ignore any false positives, {how_to_ignore}
34
            """
35
            ),
36
        )
37

38

UNCOV
39
class UnownedDependencyError(Exception):
×
40
    """The inferred dependency does not have any owner."""
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc