https://pantsbuild.org/ logo
#general
Title
# general
f

fresh-cat-90827

10/11/2022, 5:06 PM
pex
question — reading through the help, I can’t seem to find any option to do the resolve only without actually producing a
.pex
file on disk (which would download packages from the package index) — some sort of dry run where
pex
could tell me — “yes, I found the packages you are asking for given all the platform constraints you have provided”. See the thread.
1
I do
Copy code
pex my-package==1.2.3 \
 -o dist/my-package.pex \
 --platform macosx_12_0_x86_64-cp-310-cp310 \
 --platform macosx_12_0_arm64-cp-310-cp310
taking advantage of
pex
ability to resolve against multiple constraints — I only want to make sure the wheels for all the platforms are there, I don’t want to actually create a
.pex
file.
e

enough-analyst-54434

10/11/2022, 5:13 PM
Try
pex3
- it's a console script provided by the
pex
distribution. In particular you want
pex3 lock create ...
- this is what Pants uses to create lockfiles now by default.
That still downloads packages mind you, you have to to do a resolve in the Python world currently since dependency and requires-python metadata are embedded inside the distributions.
f

fresh-cat-90827

10/11/2022, 5:26 PM
ah I see, thanks, John! So the difference between running
pex
and
pex3
for my use case would be that I’ll be getting a
.pex
file vs a lock file, but the packages would still be downloaded in both cases. Is it feasible to import the
pex
Python module if I’d like to do the same thing via a Python program or it would be way easier just to do
subprocess.run(["pex"....])
and check the exit code / read errors?
e

enough-analyst-54434

10/11/2022, 5:31 PM
The easiest way to do this giving the most useful information is exactly this, in a subprocess please:
Copy code
pex3 lock create --style universal --platform first --platform next ...
❤️ 1
f

fresh-cat-90827

10/11/2022, 5:32 PM
Amazing, thanks!
e

enough-analyst-54434

10/11/2022, 5:33 PM
The lock resolve will complete (because of --style universal) but then a post process check for each platform against the lockfile can fail, but with detailed errors from PEX - not Pip.
❤️ 1
For example - Pants is not yet available for Python 3.10:
Copy code
$ pex3 lock create --style universal --platform linux_x86_64-cp-3.10.6-cp310 pantsbuild.pants
Failed to resolve compatible artifacts from lock for 1 target:
1. cp310-cp310-linux_x86_64:
    Failed to resolve all requirements for abbreviated platform cp310-cp310-linux_x86_64:

Configured with:
    build: False
    use_wheel: True

Dependency on pantsbuild-pants not satisfied, 1 incompatible candidate found:
1.) pantsbuild-pants 2.13 (via: pantsbuild.pants) requires Python <3.10,>=3.7

Dependency on setproctitle not satisfied, 1 incompatible candidate found:
1.) setproctitle 1.2.2 (via: pantsbuild.pants -> setproctitle==1.2.2) does not have any compatible artifacts:
    <https://files.pythonhosted.org/packages/2d/0b/2aa75c055667eb151a2b94bae83df650e42f666c52bd1ef9af7f457be8b1/setproctitle-1.2.2-cp36-cp36m-manylinux1_i686.whl>
    <https://files.pythonhosted.org/packages/21/8a/32fdafc0664c681507df24dbaa7c28f823a5289f03e663c51dae7f3a3278/setproctitle-1.2.2-cp38-cp38-manylinux1_i686.whl>
    <https://files.pythonhosted.org/packages/2c/62/156a441a81a8a46c9d1e3f31863eb79b12445da3e02f158bf39e7d993fe6/setproctitle-1.2.2-cp37-cp37m-win32.whl>
    <https://files.pythonhosted.org/packages/38/7e/6794cfb1d910d982221f08b0617737e454470b53d67fbb3cf831ab891b81/setproctitle-1.2.2-cp38-cp38-win_amd64.whl>
    <https://files.pythonhosted.org/packages/3b/eb/a889106a9391c44f7ec456da1ead1054ec0e7e400bd4e2e02188c8f8d901/setproctitle-1.2.2-cp39-cp39-win32.whl>
    <https://files.pythonhosted.org/packages/3c/dc/00fb59a01ed15134e6ccdd450e629418431fe9a6433b2ee9479c27660ae3/setproctitle-1.2.2-cp38-cp38-manylinux1_x86_64.whl>
    <https://files.pythonhosted.org/packages/4c/6b/a70de194afd9b65253180603a80cb19109d7c00d45c44b3454c06b822ffb/setproctitle-1.2.2-cp38-cp38-win32.whl>
    <https://files.pythonhosted.org/packages/4f/e9/c982c4e51ba106e7a14979d685cf90f9349e8175650d0e7dcffc663ba878/setproctitle-1.2.2-cp36-cp36m-win32.whl>
    <https://files.pythonhosted.org/packages/5e/59/f9fef4d0682ff03a392365322d160d8ca5257a0a782b93cea7cb7658e53e/setproctitle-1.2.2-cp39-cp39-manylinux1_x86_64.whl>
    <https://files.pythonhosted.org/packages/69/ed/20c8af2af9ec869696e8a4a777b920d9e7c7c7ce5f3f34444329f84d5953/setproctitle-1.2.2-cp39-cp39-manylinux2014_aarch64.whl>
    <https://files.pythonhosted.org/packages/7d/e1/761a1e90ac68b92e296025e7e93b24f4e0f46f92d5ae86108228312f2b22/setproctitle-1.2.2-cp38-cp38-manylinux2014_aarch64.whl>
    <https://files.pythonhosted.org/packages/7f/38/71723520cc77e4165ff76de0ea949ee957c9d4821a9ca332a9741b8daa55/setproctitle-1.2.2-cp36-cp36m-manylinux2014_aarch64.whl>
    <https://files.pythonhosted.org/packages/93/78/24acecb09c0d9d0fd66d18cede29198d273ded9637e013cc0f6e7429d6c0/setproctitle-1.2.2-cp36-cp36m-win_amd64.whl>
    <https://files.pythonhosted.org/packages/97/5c/16a6e69febfbee3f1a1a8c4318d1f054ff4d3ef2a61b233937c316cba06d/setproctitle-1.2.2-cp37-cp37m-manylinux1_x86_64.whl>
    <https://files.pythonhosted.org/packages/a1/7f/a1d4f4c7b66f0fc02f35dc5c85f45a8b4e4a7988357a29e61c14e725ef86/setproctitle-1.2.2.tar.gz>
    <https://files.pythonhosted.org/packages/b1/10/8ec969cd05fb952dc876dd74d01eff0acda9b50f44f9f80e957eaa14073d/setproctitle-1.2.2-cp37-cp37m-manylinux1_i686.whl>
    <https://files.pythonhosted.org/packages/b6/5d/c09df79458318acf027e9ccab1b8c13a26314fba302de35ca0aa7f21f76e/setproctitle-1.2.2-cp39-cp39-manylinux1_i686.whl>
    <https://files.pythonhosted.org/packages/bb/7e/9b3683a42e3aa7cba8364149fd12be1a17c8d0b5cf3f587320b86e5e0248/setproctitle-1.2.2-cp36-cp36m-manylinux1_x86_64.whl>
    <https://files.pythonhosted.org/packages/d4/49/65d5f5f9fd9e763f3aa9ceb4bb5109a6572851a98c74a01a5e968ac22adc/setproctitle-1.2.2-cp37-cp37m-manylinux2014_aarch64.whl>
    <https://files.pythonhosted.org/packages/ed/20/99e07871185c68db67ad71ec6e21f8977364b2014922904c8cc234b307bd/setproctitle-1.2.2-cp37-cp37m-win_amd64.whl>
    <https://files.pythonhosted.org/packages/ff/ea/0c249215e21b2588ac370d738873e3842ff981942202a2b9517f600fd797/setproctitle-1.2.2-cp39-cp39-win_amd64.whl>
6 Views