https://pantsbuild.org/ logo
#development
Title
# development
h

happy-kitchen-89482

10/31/2022, 5:22 PM
I get errors like
Copy code
E         A distribution for cryptography could not be resolved for /Users/benjyw/.pyenv/versions/2.7.18/bin/python2.7.
E         Found 1 distribution for cryptography that do not apply:
E         1.) The wheel tags for cryptography 2.9 are cp27-cp27mu-manylinux2010_x86_64 which do not match the supported tags of /Users/benjyw/.pyenv/versions/2.7.18/bin/python2.7:
E         cp27-cp27m-macosx_12_0_arm64
E         ... 195 more ...
E
e

enough-analyst-54434

10/31/2022, 5:22 PM
Can you help me out - which line fails?
h

happy-kitchen-89482

10/31/2022, 5:22 PM
And so on for all the other interpreters it tries
So it’s looking at the tags supported by the local platform, but from reading the test it appears that it expects to work on a foreign platform
e

enough-analyst-54434

10/31/2022, 5:23 PM
Sure, to help me page in - which test line fails?
436 I guess?
h

happy-kitchen-89482

10/31/2022, 5:24 PM
The traceback is:
Copy code
E       stderr:
E       Traceback (most recent call last):
E         File "/Users/benjyw/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 302, in find_compatible_interpreter
E           target = _select_path_interpreter(
E         File "/Users/benjyw/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 214, in _select_path_interpreter
E           for interpreter in candidate_interpreters_iter:
E         File "/Users/benjyw/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 190, in iter_compatible_interpreters
E           raise UnsatisfiableInterpreterConstraintsError(
E       pex.interpreter_constraints.UnsatisfiableInterpreterConstraintsError: Examined the following interpreters:
E       1.)                                                 /Users/benjyw/.pyenv/versions/3.10.6/bin/python3.10 CPython==3.10.6
E       2.)                  /Users/benjyw/.cache/pants/pants_dev_deps/Darwin.arm64.arm.py39.venv/bin/python3.9 CPython==3.9.13
E       3.)                                                  /Users/benjyw/.pyenv/versions/2.7.18/bin/python2.7 CPython==2.7.18
E       4.)                                                  /Users/benjyw/.pyenv/versions/3.7.13/bin/python3.7 CPython==3.7.13
E       5.)                                                  /Users/benjyw/.pyenv/versions/3.8.13/bin/python3.8 CPython==3.8.13
E       6.)    /opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/bin/python3.10 CPython==3.10.8
E       7.) /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 CPython==3.9.6
E       
E       No interpreter compatible with the requested constraints was found:
e

enough-analyst-54434

10/31/2022, 5:25 PM
create_pex_and_get_all_data does what? Does it try to load a foreign PEX with a local interpreter?
h

happy-kitchen-89482

10/31/2022, 5:26 PM
Oh, snap
h

happy-kitchen-89482

10/31/2022, 5:26 PM
It creates a pex, which may be succeeding, but then runs it in tools mode to get data out of it
e

enough-analyst-54434

10/31/2022, 5:26 PM
Yeah
h

happy-kitchen-89482

10/31/2022, 5:27 PM
So no, this test will not pass
e

enough-analyst-54434

10/31/2022, 5:27 PM
There is no pex3 info command, which would work - all PEX_TOOLS commands must be able to resolve the PEX.
h

happy-kitchen-89482

10/31/2022, 5:28 PM
Sorry, what would work?
e

enough-analyst-54434

10/31/2022, 5:28 PM
So, just flip all that test infra to unzip
h

happy-kitchen-89482

10/31/2022, 5:28 PM
yeah
e

enough-analyst-54434

10/31/2022, 5:28 PM
If there were a
pex3
subcommand equivalent - which there is not - it would work. The
pex3
commands are not tied to a specific PEX file.
h

happy-kitchen-89482

10/31/2022, 5:29 PM
Ah, right
but all we want here is PEX-INFO, which we can fish out with unzip, as you say
e

enough-analyst-54434

10/31/2022, 5:29 PM
Yeah.
The test is already tied to internals.
That's a neat test to have fail in the way it did though! Very cool.
h

happy-kitchen-89482

10/31/2022, 5:38 PM
When you can make a test work better and in fewer lines of code, that’s a win