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

pantsbuild / pants / 26260209689

21 May 2026 11:59PM UTC coverage: 75.453% (-15.7%) from 91.156%
26260209689

Pull #23365

github

web-flow
Merge 5fe873b58 into 7ea655ba0
Pull Request #23365: uv.lock -> pex optimization

5 of 16 new or added lines in 1 file covered. (31.25%)

10118 existing lines in 378 files now uncovered.

54669 of 72454 relevant lines covered (75.45%)

2.31 hits per line

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

92.73
/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
5✔
5

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

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

11

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

18
    def __init__(
5✔
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))
5✔
25
        object.__setattr__(self, "string_candidates", FrozenDict(string_candidates))
5✔
26
        object.__setattr__(self, "explicit_dependencies", FrozenDict(explicit_dependencies))
5✔
27

28

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

33

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

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

43

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

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

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

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

63

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

68

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

78
    def __init__(
5✔
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)
4✔
88
        object.__setattr__(self, "build_args", tuple(build_args))
4✔
89
        object.__setattr__(self, "copy_source_paths", tuple(copy_source_paths))
4✔
90
        object.__setattr__(self, "copy_build_args", tuple(copy_build_args))
4✔
91
        object.__setattr__(self, "from_image_build_args", tuple(from_image_build_args))
4✔
92
        object.__setattr__(self, "version_tags", tuple(version_tags))
4✔
93

94

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