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

pantsbuild / pants / 20974506033

13 Jan 2026 10:14PM UTC coverage: 43.251% (-37.0%) from 80.269%
20974506033

Pull #22976

github

web-flow
Merge a16a40040 into c12556724
Pull Request #22976: WIP: Add the ability to set stdin for a Process

2 of 4 new or added lines in 2 files covered. (50.0%)

17213 existing lines in 540 files now uncovered.

26146 of 60452 relevant lines covered (43.25%)

0.86 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

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

24

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

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

UNCOV
36
    default_main = ConsoleScript("elfdeps")
×
UNCOV
37
    default_requirements = ["elfdeps>=0.2.0"]
×
38

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

UNCOV
42
    default_lockfile_resource = (_ELFDEPS_PACKAGE, "elfdeps.lock")
×
43

44

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

49

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

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

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

73

UNCOV
74
def rules() -> Iterable[Rule]:
×
UNCOV
75
    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