• 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

87.5
/src/python/pants/backend/python/subsystems/uv.py
1
# Copyright 2026 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
2✔
5

6
from dataclasses import dataclass
2✔
7

8
from pants.core.util_rules.external_tool import (
2✔
9
    TemplatedExternalTool,
10
    download_external_tool,
11
)
12
from pants.engine.fs import Digest
2✔
13
from pants.engine.platform import Platform
2✔
14
from pants.engine.rules import collect_rules, rule
2✔
15
from pants.option.option_types import ArgsListOption
2✔
16
from pants.util.strutil import softwrap
2✔
17

18

19
class Uv(TemplatedExternalTool):
2✔
20
    options_scope = "uv"
2✔
21
    name = "uv"
2✔
22
    help = "The uv Python package manager (https://github.com/astral-sh/uv)."
2✔
23

24
    default_version = "0.6.14"
2✔
25
    default_known_versions = [
2✔
26
        "0.6.14|macos_x86_64|1d8ecb2eb3b68fb50e4249dc96ac9d2458dc24068848f04f4c5b42af2fd26552|16276555",
27
        "0.6.14|macos_arm64|4ea4731010fbd1bc8e790e07f199f55a5c7c2c732e9b77f85e302b0bee61b756|15138933",
28
        "0.6.14|linux_x86_64|0cac4df0cb3457b154f2039ae471e89cd4e15f3bd790bbb3cb0b8b40d940b93e|17032361",
29
        "0.6.14|linux_arm64|94e22c4be44d205def456427639ca5ca1c1a9e29acc31808a7b28fdd5dcf7f17|15577079",
30
    ]
31
    version_constraints = ">=0.6.0,<1.0"
2✔
32

33
    default_url_template = (
2✔
34
        "https://github.com/astral-sh/uv/releases/download/{version}/uv-{platform}.tar.gz"
35
    )
36
    default_url_platform_mapping = {
2✔
37
        "linux_arm64": "aarch64-unknown-linux-musl",
38
        "linux_x86_64": "x86_64-unknown-linux-musl",
39
        "macos_arm64": "aarch64-apple-darwin",
40
        "macos_x86_64": "x86_64-apple-darwin",
41
    }
42

43
    def generate_exe(self, plat: Platform) -> str:
2✔
UNCOV
44
        platform = self.default_url_platform_mapping[plat.value]
×
UNCOV
45
        return f"./uv-{platform}/uv"
×
46

47
    args_for_uv_pip_install = ArgsListOption(
2✔
48
        tool_name="uv",
49
        example="--index-strategy unsafe-first-match",
50
        extra_help=softwrap(
51
            """
52
            Additional arguments to pass to `uv pip install` invocations.
53

54
            Used when `[python].pex_builder = "uv"` to pass extra flags to the
55
            `uv pip install` step (e.g. `--index-url`, `--extra-index-url`).
56
            These are NOT passed to the `uv venv` step.
57
            """
58
        ),
59
    )
60

61

62
@dataclass(frozen=True)
2✔
63
class DownloadedUv:
2✔
64
    """The downloaded uv binary with user-configured args."""
65

66
    digest: Digest
2✔
67
    exe: str
2✔
68
    args_for_uv_pip_install: tuple[str, ...]
2✔
69

70

71
@rule
2✔
72
async def download_uv_binary(uv: Uv, platform: Platform) -> DownloadedUv:
2✔
UNCOV
73
    downloaded = await download_external_tool(uv.get_request(platform))
×
UNCOV
74
    return DownloadedUv(
×
75
        digest=downloaded.digest,
76
        exe=downloaded.exe,
77
        args_for_uv_pip_install=tuple(uv.args_for_uv_pip_install),
78
    )
79

80

81
def rules():
2✔
82
    return collect_rules()
2✔
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