I have an issue I'm pretty stumped on. At first I ...
# general
b
I have an issue I'm pretty stumped on. At first I thought it was the same thing that @elegant-florist-94385 hit here, but that hasn't checked out https://pantsbuild.slack.com/archives/C046T6T9U/p1755096604640549 The package of issue is numpy-typing-compat, pulled in transitively from my scipy-stubs python_requirements. It's an optional dependency of optype, but I know pants treats optional deps the same as required deps
Copy code
scipy-stubs (1.16.1.0)
└── optype[numpy]<0.14,>=0.13.1
    └── numpy-typing-compat>=1.25.20250730
When I run
mypy
via
pants check <target>
, I always hit this issue
Copy code
[INFO] Completed: Scheduling: Building requirements_venv.pex
[ERROR] 1 Exception encountered:

Engine traceback:
  in `check` goal

ProcessExecutionFailure: Process 'Building requirements_venv.pex' failed with exit code 1.
stdout:
stderr:
[Errno 13] Permission denied: '/Users/gregory.fast/.cache/pants/named_caches/pex_root/installed_wheels/0/9ab0cd4bb1b4c31debf0bd745554c735a07a7bb3cc3801dc934b2b5856549612/numpy_typing_compat-2.3.20250730-py3-none-any.whl.lck.work/numpy_typing_compat-2.3.20250730.dist-info/licenses/LICENSE'
The downloaded wheel itself seems to have normal permissions (is readable)
Copy code
-rw-r--r-- 1 gregory.fast staff 6057 Aug 14 14:20 /Users/gregory.fast/.cache/pants/named_caches/pex_root/downloads/1/9ab0cd4bb1b4c31debf0bd745554c735a07a7bb3cc3801dc934b2b5856549612/numpy_typing_compat-2.3.20250730-py3-none-any.whl
so I inspected the wheels files and they seem normal too
Copy code
% ls -lR /tmp/numpy_typing_compat_extracted
/tmp/numpy_typing_compat_extracted:
total 0
drwxr-xr-x 4 gregory.fast wheel 128 Aug 14 14:11 numpy_typing_compat
drwxr-xr-x 6 gregory.fast wheel 192 Aug 14 14:11 numpy_typing_compat-2.3.20250730.dist-info

/tmp/numpy_typing_compat_extracted/numpy_typing_compat:
total 4
-rw-r--r-- 1 gregory.fast wheel 2382 Aug 14 14:11 __init__.py
-rw-r--r-- 1 gregory.fast wheel    0 Aug 14 14:11 py.typed

/tmp/numpy_typing_compat_extracted/numpy_typing_compat-2.3.20250730.dist-info:
total 16
drwxr-xr-x 3 gregory.fast wheel   96 Aug 14 14:11 licenses
-rw-r--r-- 1 gregory.fast wheel 7076 Aug 14 14:11 METADATA
-rw-r--r-- 1 gregory.fast wheel  654 Aug 14 14:11 RECORD
-rw-r--r-- 1 gregory.fast wheel   78 Aug 14 14:11 WHEEL

/tmp/numpy_typing_compat_extracted/numpy_typing_compat-2.3.20250730.dist-info/licenses:
total 4
-rw-r--r-- 1 gregory.fast wheel 1495 Aug 14 14:11 LICENSE
I want to at least open an issue with the package owner or on pantsbuild (if it's pants related), but I'm stuck unable to identify the root cause. any tips? 🙏 Also, is there any way to exclude an optional package from a lockfile?
I'm using pants 2.27; haven't configured the pex-tool version so it's the v2.37.0 default
actually I guess it's this simple
Copy code
pex -o numpy_typing_compat.pex numpy_typing_compat==2.1.20250730

[Errno 13] Permission denied: '/Users/gregory.fast/Library/Caches/pex/installed_wheels/0/1893fcb94dd67ce6f5110caebcfce36e937371ee5c6050dab9713bfe73d47b87/numpy_typing_compat-2.1.20250730-py3-none-any.whl.1e9aa1460a6a46d58f401303f4a1d9ea.work/numpy_typing_compat-2.1.20250730.dist-info/licenses/LICENSE'
Made an issue for that package, but I still don't know if this is really a
pex
problem or
numpy-typing-compat
problem https://github.com/jorenham/numpy-typing-compat/issues/40
actually... maybe it's the exact same issue that Luke hit with
faststream
Copy code
ll /Users/gregory.fast/Library/Caches/pex/installed_wheels/0/7d7639eafb5bc399650ae6d4baf441dfa0a40eb06965fd85e7f6d4dfe2e34ff7/numpy_typing_compat-2.2.20250730-py3-none-any.whl.1005f0179e8044a7ae384fd83ffa03b5.work/numpy_typing_compat-2.2.20250730.dist-info/licenses/LICENSE
--w--wx--- 1 gregory.fast staff 1495 Aug 14 15:33 /Users/gregory.fast/Library/Caches/pex/installed_wheels/0/7d7639eafb5bc399650ae6d4baf441dfa0a40eb06965fd85e7f6d4dfe2e34ff7/numpy_typing_compat-2.2.20250730-py3-none-any.whl.1005f0179e8044a7ae384fd83ffa03b5.work/numpy_typing_compat-2.2.20250730.dist-info/licenses/LICENSE
we see --w--wx--- on the LICENSE file
b
I think you've got this mostly sorted, but a few things: 1. The optional dep is not optional since scipy-stubs non-optionally depends on it: https://github.com/scipy/scipy-stubs/blob/8244740b905d566be8e024969ef6c43768dd3efa/pyproject.toml#L39 2. You can force
--exclude
deps with pex (or
--override
deps), but, as far as I'm aware, Pants does not support these options. 3. It is the same issue Luke hit since - obscuredly to be sure - numpy-typing-compat uses uv_build via its build.py. But you don't need to look at the repo, just look at the wheel (download it from PyPI: https://pypi.org/project/numpy-typing-compat/2.3.20250730/#files):
Copy code
:; zipinfo ~/Downloads/numpy_typing_compat-2.3.20250730-py3-none-any.whl 
Archive:  /home/jsirois/Downloads/numpy_typing_compat-2.3.20250730-py3-none-any.whl
Zip file size: 6057 bytes, number of entries: 9
drwxr-xr-x  2.0 unx        0 b- stor 80-Jan-01 00:00 numpy_typing_compat/
--w--wx---  2.0 unx     2382 b- defN 80-Jan-01 00:00 numpy_typing_compat/__init__.py
--w--wx---  2.0 unx        0 b- defN 80-Jan-01 00:00 numpy_typing_compat/py.typed
drwxr-xr-x  2.0 unx        0 b- stor 80-Jan-01 00:00 numpy_typing_compat-2.3.20250730.dist-info/licenses/
--w--wx---  2.0 unx     1495 b- defN 80-Jan-01 00:00 numpy_typing_compat-2.3.20250730.dist-info/licenses/LICENSE
drwxr-xr-x  2.0 unx        0 b- stor 80-Jan-01 00:00 numpy_typing_compat-2.3.20250730.dist-info/
-rw-r--r--  2.0 unx       78 b- defN 80-Jan-01 00:00 numpy_typing_compat-2.3.20250730.dist-info/WHEEL
-rw-r--r--  2.0 unx     7076 b- defN 80-Jan-01 00:00 numpy_typing_compat-2.3.20250730.dist-info/METADATA
--w--wx---  2.0 unx      654 b- defN 80-Jan-01 00:00 numpy_typing_compat-2.3.20250730.dist-info/RECORD
9 files, 11685 bytes uncompressed, 4589 bytes compressed:  60.7%
And it's even the 0.8.3 buggy version I mentioned in @elegant-florist-94385's thread.
Copy code
:; unzip -qc ~/Downloads/numpy_typing_compat-2.3.20250730-py3-none-any.whl numpy_typing_compat-2.3.20250730.dist-info/WHEEL
Wheel-Version: 1.0
Generator: uv 0.8.3
Root-Is-Purelib: true
Tag: py3-none-any
Basically, Pants users should expect a moderately wide blast radius of the uv 0.8.3 release which shipped a buggy
uv_build
to the world and there are apparently a decent number of projects in the wild using
uv_build
as their build-backend.
b
Ahhhh I see. (shakes fist at
uv_build
) Thanks John, this is really helpful, and TIL how to quickly inspect .whl files For #2, I think you can sneak in
excludes
on extra_build_args of the pex_binary target, but that only applies to your own
pex_binary
targets in BUILD files, not something like the
requirements_venv.pex
that pants builds for
pants check
.