• 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/backend/python/goals/run_pex_binary.py
1
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
import os
×
5

UNCOV
6
from pants.backend.python.goals.package_pex_binary import (
×
7
    PexBinaryFieldSet,
8
    built_package_for_pex_from_targets_request,
9
    package_pex_binary,
10
)
UNCOV
11
from pants.backend.python.target_types import PexLayout
×
UNCOV
12
from pants.backend.python.util_rules.pex import find_interpreter
×
UNCOV
13
from pants.core.goals.run import RunRequest
×
UNCOV
14
from pants.engine.rules import collect_rules, implicitly, rule
×
UNCOV
15
from pants.util.logging import LogLevel
×
16

17

UNCOV
18
@rule(level=LogLevel.DEBUG)
×
UNCOV
19
async def create_pex_binary_run_request(field_set: PexBinaryFieldSet) -> RunRequest:
×
20
    pex_request = await package_pex_binary(field_set, **implicitly())
×
21
    built_pex = await built_package_for_pex_from_targets_request(field_set, **implicitly())
×
22

23
    # We need a Python executable to fulfil `adhoc_tool`/`runnable_dependency` requests
24
    # as sandboxed processes will not have a `python` available on the `PATH`.
25
    python = await find_interpreter(
×
26
        **implicitly(pex_request.request.to_interpreter_constraints_request())
27
    )
28

29
    relpath = built_pex.artifacts[0].relpath
×
30
    assert relpath is not None
×
31
    if field_set.layout.value != PexLayout.ZIPAPP.value:
×
32
        relpath = os.path.join(relpath, "__main__.py")
×
33

34
    return RunRequest(
×
35
        digest=built_pex.digest,
36
        args=[python.path, os.path.join("{chroot}", relpath)],
37
    )
38

39

40
# NB: Technically we could implement RunDebugAdapterRequest by using `debugpy`.
41
# However it is unclear how the user would be able to debug the code,
42
# as the client and server will disagree on the code's path.
43

44

UNCOV
45
def rules():
×
UNCOV
46
    return [
×
47
        *collect_rules(),
48
        *PexBinaryFieldSet.rules(),
49
    ]
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