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

pantsbuild / pants / 24055979590

06 Apr 2026 11:17PM UTC coverage: 52.37% (-40.5%) from 92.908%
24055979590

Pull #23225

github

web-flow
Merge 67474653c into 542ca048d
Pull Request #23225: Add --test-show-all-batch-targets to expose all targets in batched pytest

6 of 17 new or added lines in 2 files covered. (35.29%)

23030 existing lines in 605 files now uncovered.

31643 of 60422 relevant lines covered (52.37%)

1.05 hits per line

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

0.0
/src/python/pants/backend/nfpm/native_libs/elfdeps/subsystem.py
1
# Copyright 2025 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from __future__ import annotations
×
5

UNCOV
6
from collections.abc import Iterable
×
UNCOV
7
from dataclasses import dataclass
×
UNCOV
8
from pathlib import PurePath
×
9

UNCOV
10
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
×
UNCOV
11
from pants.backend.python.target_types import ConsoleScript, EntryPoint
×
UNCOV
12
from pants.backend.python.util_rules.pex import VenvPex, create_venv_pex
×
UNCOV
13
from pants.engine.fs import CreateDigest, FileContent
×
UNCOV
14
from pants.engine.intrinsics import create_digest
×
UNCOV
15
from pants.engine.rules import Rule, collect_rules, implicitly, rule
×
UNCOV
16
from pants.util.logging import LogLevel
×
UNCOV
17
from pants.util.resources import read_resource
×
UNCOV
18
from pants.util.strutil import help_text
×
19

20
# pants: infer-dep(elfdeps.lock*)
21

UNCOV
22
_ELFDEPS_PACKAGE = "pants.backend.nfpm.native_libs.elfdeps"
×
UNCOV
23
_ANALYZE_SCRIPT = "analyze.py"
×
UNCOV
24
_ANALYZE_TOOL = "__pants_elfdeps_analyze.py"
×
25

26

UNCOV
27
class Elfdeps(PythonToolBase):
×
UNCOV
28
    options_scope = "elfdeps"
×
UNCOV
29
    help_short = help_text(
×
30
        """
31
        Used to analyze ELF binaries.
32

33
        Both elfdeps and pyelftools (used by elfdeps) are pure-python libraries,
34
        so this should be portable across platforms.
35
        """
36
    )
37

UNCOV
38
    default_main = ConsoleScript("elfdeps")
×
UNCOV
39
    default_requirements = ["elfdeps>=0.2.0"]
×
40

UNCOV
41
    default_interpreter_constraints = ["CPython>=3.10,<3.15"]
×
UNCOV
42
    register_interpreter_constraints = True
×
43

UNCOV
44
    default_lockfile_resource = (_ELFDEPS_PACKAGE, "elfdeps.lock")
×
45

46

UNCOV
47
@dataclass(frozen=True)
×
UNCOV
48
class ElfdepsAnalyzeWheelsTool:
×
UNCOV
49
    pex: VenvPex
×
50

51

UNCOV
52
@rule(desc=f"Setup elfdeps/{_ANALYZE_SCRIPT}", level=LogLevel.DEBUG)
×
UNCOV
53
async def setup_elfdeps_analyze_tool(
×
54
    _elfdeps: Elfdeps,
55
) -> ElfdepsAnalyzeWheelsTool:
UNCOV
56
    analyze_script = read_resource(_ELFDEPS_PACKAGE, _ANALYZE_SCRIPT)
×
UNCOV
57
    if not analyze_script:
×
58
        raise ValueError(f"Unable to find source of {_ANALYZE_SCRIPT!r} in {_ELFDEPS_PACKAGE}")
×
59

UNCOV
60
    analyze_script_content = FileContent(
×
61
        path=_ANALYZE_TOOL, content=analyze_script, is_executable=True
62
    )
UNCOV
63
    analyze_script_digest = await create_digest(CreateDigest([analyze_script_content]))
×
64

UNCOV
65
    analyze_pex = await create_venv_pex(
×
66
        **implicitly(
67
            _elfdeps.to_pex_request(
68
                main=EntryPoint(PurePath(analyze_script_content.path).stem),
69
                sources=analyze_script_digest,
70
            )
71
        )
72
    )
UNCOV
73
    return ElfdepsAnalyzeWheelsTool(analyze_pex)
×
74

75

UNCOV
76
def rules() -> Iterable[Rule]:
×
UNCOV
77
    return collect_rules()
×
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