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

pantsbuild / pants / 18727405282
80%

Build:
DEFAULT BRANCH: main
Ran 22 Oct 2025 07:37PM UTC
Jobs 11
Files 1715
Run time 4min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Oct 2025 07:22PM UTC coverage: 80.276% (+0.01%) from 80.262%
18727405282

push

github

web-flow
Enable scoping indexes for specific projects/platforms when generating lockfiles (#22760)

### Problem
The current `generate-lockfiles` goal only allows one locked version for
each requirement. This leads to issues when using certain libraries like
Pytorch and Tensorflow which have some complexities in the way the
wheels are published and tagged. See
https://github.com/pantsbuild/pants/issues/18965

An example with pytorch: the Linux wheels published to PyPI include cuda
dependencies, while the macos ones do not. There is a `+cpu` tag in the
pytorch-hosted index, _but only for Linux_. The current setup means that
we can't lock a cpu-only version of pytorch that works on both macos and
linux.

### Proposed solution
As of [pex 2.56.0](https://github.com/pex-tool/pex/releases/tag/v2.56.0)
it is possible to create a universal lock with two locked resolves (one
for macos, one for linux) by adding an appropriately scoped index:
```bash
pex3 lock create \
    --style universal \
    --target-system linux \
    --target-system mac \
    --elide-unused-requires-dist \
    --interpreter-constraint "CPython==3.13.*" \
    --index pytorch=https://download.pytorch.org/whl/cpu \
    --source "pytorch=torch; sys_platform != 'darwin'" \
    --indent 2 \
    -o lock.json \
    torch
```
This PR adds the option of specifying sources through a new
`[python.resolves_to_sources]` option. Named indexes can already be
defined in `[python-repos.indexes]`

94 of 96 new or added lines in 6 files covered. (97.92%)

3 existing lines in 1 file now uncovered.

77860 of 96990 relevant lines covered (80.28%)

3.08 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
83.7
-0.27% src/python/pants/backend/python/subsystems/setup.py
1
72.14
-0.06% src/python/pants/backend/python/util_rules/pex_requirements.py

Uncovered Existing Lines

Lines Coverage ∆ File
3
81.25
-4.69% src/python/pants/testutil/python_interpreter_selection.py
Jobs
ID Job ID Ran Files Coverage
1 test_python_macos13_x86_64 - 18727405282.1 22 Oct 2025 08:12PM UTC 1158
42.87
GitHub Action Run
2 test_python_linux_x86_64_0/10 - 18727405282.2 22 Oct 2025 07:42PM UTC 1196
45.56
GitHub Action Run
3 test_python_linux_x86_64_5/10 - 18727405282.3 22 Oct 2025 07:38PM UTC 1192
48.18
GitHub Action Run
4 test_python_linux_x86_64_4/10 - 18727405282.4 22 Oct 2025 07:50PM UTC 1208
49.98
GitHub Action Run
5 test_python_linux_x86_64_3/10 - 18727405282.5 22 Oct 2025 07:43PM UTC 1175
45.68
GitHub Action Run
6 test_python_linux_x86_64_7/10 - 18727405282.6 22 Oct 2025 07:48PM UTC 1182
42.73
GitHub Action Run
7 test_python_linux_x86_64_2/10 - 18727405282.7 22 Oct 2025 07:38PM UTC 1178
46.9
GitHub Action Run
8 test_python_linux_x86_64_1/10 - 18727405282.8 22 Oct 2025 07:42PM UTC 1175
40.22
GitHub Action Run
9 test_python_linux_x86_64_8/10 - 18727405282.9 22 Oct 2025 07:45PM UTC 1178
45.44
GitHub Action Run
10 test_python_linux_x86_64_9/10 - 18727405282.10 22 Oct 2025 07:40PM UTC 1183
45.1
GitHub Action Run
11 test_python_linux_x86_64_6/10 - 18727405282.11 22 Oct 2025 07:37PM UTC 1172
40.77
GitHub Action Run
Source Files on build 18727405282
  • Tree
  • List 1715
  • Changed 18
  • Source Changed 9
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18727405282
  • 725b949b on github
  • Prev Build on main (#18721278411)
  • Next Build on main (#18734971616)
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