Is there a way to configure python resolves to use...
# general
b
Is there a way to configure python resolves to use only binaries by default, but allow certain packages to be exceptions? In this case, I need to make an exception for pyspark because they don’t publish prebuilt wheels I tried (1) seeing if exclusion syntax works it (doesn’t)
Copy code
[python.resolves_to_only_binary]
__default__ = [":all:", "!pyspark"]
error
```stderr:
pid 54908 -> /Users/gregory.fast/.cache/pants/named_caches/pex_root/venvs/1/4ff2f56ac3254236a25efbdabc197b860c992fbd/dfd2c09fe12009f8446c34db0afc997702969a55/bin/python /Users/gregory.fast/.cache/pants/named_caches/pex_root/venvs/1/4ff2f56ac3254236a25efbdabc197b860c992fbd/dfd2c09fe12009f8446c34db0afc997702969a55/pex --disable-pip-version-check --exists-action a --no-input --isolated --log pex-pip-download.log -q --cache-dir /Users/gregory.fast/.cache/pants/named_caches/pex_root/pip/1/25.2/pip_cache download --dest /private/var/folders/19/qfvft6053wvdm7yfbgcg08d40000gp/T/pants-sandbox-iv6uS1/.tmp/tmprbumncl8/Users.gregory.fast..pyenv.versions.3.12.10.bin.python3.12 --only-binary all psutil>=7.0.0 pyspark==3.5.4 --index-url https://depot-read-api-python.us1.ddbuild.io/magicmirror/magicmirror/@current/simple/ --retries 5 --resume-retries 3 --timeout 15 exited with 1 and STDERR:
pip: ERROR: Could not find a version that satisfies the requirement pyspark==3.5.4 (from versions: none)
pip: ERROR: No matching distribution found for pyspark==3.5.4```
(2) seeing if I could put exclusions in no_binary
Copy code
[python.resolves_to_only_binary]
__default__ = [":all:"] 

[python.resolves_to_no_binary]
__default__ = ["pyspark"]
error
```stderr:
Builds were disallowed, but the following project names are configured to only allow building: pyspark```
b
🤦 This is Pex nannying: https://github.com/pex-tool/pex/issues/3022 I should have a fix released in a few hours. I'll update here when its available.
To be clear, this Pex fix should allow your approach #2 to work. Approach #1 would require Pants work to support turning
!<thing>
into the appropriate Pex flag.
b
ah I see, I figured
pants
wasn't passing the right args to
pex
. or that this was possible today with some not-fully-documented behavior. thanks as always for the super fast turnaround, I really appreciate it (and yeah, Approach #1 was a longer shot)
b
Alrighty, the fix is released here: https://github.com/pex-tool/pex/releases/tag/v2.71.1
b
thank you!