millions-kilobyte-51167
07/25/2022, 8:48 AMenough-analyst-54434
07/25/2022, 10:37 AMmillions-kilobyte-51167
07/26/2022, 8:01 AMmillions-kilobyte-51167
07/26/2022, 8:46 AM--repo
and --no-pypi
in conjunction with abi3 wheels
# my env:
$ python --version
Python 3.9.7
$ pex --version
2.1.101
# works
$ pex cryptography --platform linux_x86_64-cp-39-cp39 --output-file cryptography.pex
# doesn't work
$ pip wheel cryptography -w wheelhouse
[...]
Saved ./wheelhouse/cryptography-37.0.4-cp36-abi3-manylinux_2_24_x86_64.whl
Saved ./wheelhouse/cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./wheelhouse/pycparser-2.21-py2.py3-none-any.whl
$ poetry run pex cryptography --repo wheelhouse --no-pypi --platform linux_x86_64-cp-39-cp39 --output-file cryptography.pex
[...]
ERROR: Could not find a version that satisfies the requirement cryptography (from versions: none)
ERROR: No matching distribution found for cryptography
millions-kilobyte-51167
07/26/2022, 8:47 AMenough-analyst-54434
07/26/2022, 1:22 PM--complete-platform
, there is not enough information in --platform
(an abbreviated platform) to fully characterize a foreign platform. See this documentation (or pex --help
) to learn how to gather --complete-platform
data: https://pex.readthedocs.io/en/v2.1.101/buildingpex.html#complete-platformenough-analyst-54434
07/26/2022, 1:26 PM--platform
because, for example, you build the PEX on a Mac but want to run it on Linux? If not, you may not need to use --platform
or --complete-platform
at all.millions-kilobyte-51167
07/27/2022, 5:44 AMmillions-kilobyte-51167
07/27/2022, 6:58 AMpex3 interpreter inspect
which I passed a python3.8 and python3.9 interpreter as the --complete-platform
argument (attached the file). I dropped the --no-pypi
flag, since it seems to complicate things for little gain. The pex builds correctly, but:
⢠I needed to pre-build dependencies locally that only have source releases, since the pex download
command that is run internally uses --only-binary :all:
for some reason
⢠the interpreter I'm using to build the pex is 3.9, and it's not including binary wheels for 3.8:
No interpreter compatible with the requested constraints was found:
A distribution for cffi could not be resolved for /usr/local/bin/python3.8.
Found 1 distribution for cffi that do not apply:
1.) The wheel tags for cffi 1.15.1 are cp39-cp39-manylinux_2_17_x86_64, cp39-cp39-manylinux2014_x86_64 which do not match the supported tags of /usr/local/bin/python3.8:
cp38-cp38-manylinux_2_31_x86_64
... 598 more ...
It's working if a 3.9 interpreter is available. I can't test on mac yet, but it would obviously not work yet because I don't know how to include it's info in the supported_platforms.jsonenough-analyst-54434
07/27/2022, 7:02 AMsince theThat's because Pex has no magic to cross-build an sdist on Linux for Mac.command that is run internally usespex download
for some reason--only-binary :all:
enough-analyst-54434
07/27/2022, 7:03 AMenough-analyst-54434
07/27/2022, 7:06 AMpex3 interpreter inspect
command line(s) you use?enough-analyst-54434
07/27/2022, 7:11 AMpex3 interpreter inspect --python /this/python --markers --tags --indent 2 -o platform1.json
4 times, once on each platform / python you're targeting. Back in Pants you have 4 different file(...)
targets.millions-kilobyte-51167
07/27/2022, 7:18 AMpex3 interpreter inspect --markers --tags --python /home/arecknagel/pythons/pyenv/versions/3.8.12/bin/python --python /home/arecknagel/pythons/pyenv/versions/3.9.7/bin/python
, and then the resulting json is as follows, probably a more saneenough-analyst-54434
07/27/2022, 7:29 AM--python
per file. So run that 2x, each with 1 --python
instead of 1x with 2 --python
like you did. That way you generate 2 different complete platform files.enough-analyst-54434
07/27/2022, 7:30 AMenough-analyst-54434
07/27/2022, 7:32 AM--platform
with a --complete-platform
file, one for one.millions-kilobyte-51167
07/27/2022, 7:34 AMenough-analyst-54434
07/27/2022, 7:35 AMmillions-kilobyte-51167
07/27/2022, 7:38 AMenough-analyst-54434
07/27/2022, 7:36 PM