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

pantsbuild / pants / 21916337275

11 Feb 2026 05:47PM UTC coverage: 80.35%. Remained the same
21916337275

Pull #23092

github

web-flow
Merge 3c07d7d7a into 9a67b81d3
Pull Request #23092: Support for a `# pants: infer-dep(...)` pragma.

9 of 11 new or added lines in 3 files covered. (81.82%)

1 existing line in 1 file now uncovered.

78773 of 98037 relevant lines covered (80.35%)

3.36 hits per line

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

74.55
/src/python/pants/engine/internals/native_dep_inference.py
1
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
12✔
5

6
from dataclasses import dataclass
12✔
7
from typing import AbstractSet, Sequence
12✔
8

9
from pants.util.frozendict import FrozenDict
12✔
10

11

12
@dataclass(frozen=True)
12✔
13
class NativePythonFileDependencies:
12✔
14
    imports: FrozenDict[str, tuple[int, bool]]
12✔
15
    string_candidates: FrozenDict[str, int]
12✔
16
    explicit_dependencies: FrozenDict[str, int]
12✔
17

18
    def __init__(
12✔
19
        self,
20
        imports: dict[str, tuple[int, bool]],
21
        string_candidates: dict[str, int],
22
        explicit_dependencies: dict[str, int],
23
    ):
24
        object.__setattr__(self, "imports", FrozenDict(imports))
×
25
        object.__setattr__(self, "string_candidates", FrozenDict(string_candidates))
×
NEW
26
        object.__setattr__(self, "explicit_dependencies", FrozenDict(explicit_dependencies))
×
27

28

29
@dataclass(frozen=True)
12✔
30
class NativePythonFilesDependencies:
12✔
31
    path_to_deps: FrozenDict[str, NativePythonFileDependencies]
12✔
32

33

34
@dataclass(frozen=True)
12✔
35
class JavascriptDependencyCandidate:
12✔
36
    file_imports: frozenset[str]
12✔
37
    package_imports: frozenset[str]
12✔
38

39
    def __init__(self, file_imports: AbstractSet[str], package_imports: AbstractSet[str]):
12✔
40
        object.__setattr__(self, "file_imports", frozenset(file_imports))
×
41
        object.__setattr__(self, "package_imports", frozenset(package_imports))
×
42

43

44
@dataclass(frozen=True)
12✔
45
class NativeJavascriptFileDependencies:
12✔
46
    imports: FrozenDict[str, JavascriptDependencyCandidate]
12✔
47

48
    def __init__(self, imports: dict[str, JavascriptDependencyCandidate]):
12✔
49
        object.__setattr__(self, "imports", FrozenDict(imports))
×
50

51
    @property
12✔
52
    def file_imports(self) -> frozenset[str]:
12✔
53
        return frozenset(
×
54
            string for candidate in self.imports.values() for string in candidate.file_imports
55
        )
56

57
    @property
12✔
58
    def package_imports(self) -> frozenset[str]:
12✔
59
        return frozenset(
×
60
            string for candidate in self.imports.values() for string in candidate.package_imports
61
        )
62

63

64
@dataclass(frozen=True)
12✔
65
class NativeJavascriptFilesDependencies:
12✔
66
    path_to_deps: FrozenDict[str, NativeJavascriptFileDependencies]
12✔
67

68

69
@dataclass(frozen=True)
12✔
70
class NativeDockerfileInfo:
12✔
71
    source: str
12✔
72
    build_args: tuple[str, ...]  # "ARG_NAME=VALUE", ...
12✔
73
    copy_source_paths: tuple[str, ...]
12✔
74
    copy_build_args: tuple[str, ...]  # "ARG_NAME=UPSTREAM_TARGET_ADDRESS", ...
12✔
75
    from_image_build_args: tuple[str, ...]  # "ARG_NAME=UPSTREAM_TARGET_ADDRESS", ...
12✔
76
    version_tags: tuple[str, ...]  # "STAGE TAG", ...
12✔
77

78
    def __init__(
12✔
79
        self,
80
        source: str,
81
        build_args: Sequence[str],
82
        copy_source_paths: Sequence[str],
83
        copy_build_args: Sequence[str],
84
        from_image_build_args: Sequence[str],
85
        version_tags: Sequence[str],
86
    ):
87
        object.__setattr__(self, "source", source)
×
88
        object.__setattr__(self, "build_args", tuple(build_args))
×
89
        object.__setattr__(self, "copy_source_paths", tuple(copy_source_paths))
×
90
        object.__setattr__(self, "copy_build_args", tuple(copy_build_args))
×
91
        object.__setattr__(self, "from_image_build_args", tuple(from_image_build_args))
×
92
        object.__setattr__(self, "version_tags", tuple(version_tags))
×
93

94

95
@dataclass(frozen=True)
12✔
96
class NativeDockerfileInfos:
12✔
97
    path_to_infos: FrozenDict[str, NativeDockerfileInfo]
12✔
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

© 2026 Coveralls, Inc