<@U04S45AHA> Would you expect this test to pass on...
# development
h
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
Can you help me out - which line fails?
h
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
Sure, to help me page in - which test line fails?
436 I guess?
h
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
create_pex_and_get_all_data does what? Does it try to load a foreign PEX with a local interpreter?
h
Oh, snap
h
It creates a pex, which may be succeeding, but then runs it in tools mode to get data out of it
e
Yeah
h
So no, this test will not pass
e
There is no pex3 info command, which would work - all PEX_TOOLS commands must be able to resolve the PEX.
h
Sorry, what would work?
e
So, just flip all that test infra to unzip
h
yeah
e
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
Ah, right
but all we want here is PEX-INFO, which we can fish out with unzip, as you say
e
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
When you can make a test work better and in fewer lines of code, that’s a win