pants versions: `1.23.0` Trying to run unit test w...
# general
pants versions:
Trying to run unit test with
and start seeing issues like this today:
Copy code
Failed to execute PEX file, missing linux_x86_64-cp-27-cp27mu compatible dependencies for:
With verbose:
Copy code
pex: Failed to resolve a requirement: The 'zipp>=0.5' distribution was not found and is required by importlib-metadata
                     pex: Activating PEX virtual environment from /home/zxiong/cruise/mlp-ark/.pants.d/test/pytest-prep/CPython-2.7.15/88508bc93f076e9344b70c0dbc1c3bca526914f7 :: Resolving unittest2>=1.1$0; python_version < "3"
                     pex: Unresolved requirements:
                     pex:   - importlib-metadata
                     pex:   - zipp
                     pex: Distributions contained within this pex:
                     pex:   - more_itertools-5.0.0-py2-none-any.whl
                     pex:   - pathlib2-2.3.5-py2.py3-none-any.whl
                     pex:   - configparser-4.0.2-py2.py3-none-any.whl
                     pex:   - six-1.14.0-py2.py3-none-any.whl
                     pex:   - pytest_mock-1.10.4-py2.py3-none-any.whl
                     pex:   - argparse-1.4.0-py2.py3-none-any.whl
                     pex:   - linecache2-1.0.0-py2.py3-none-any.whl
                     pex:   - py-1.8.1-py2.py3-none-any.whl
                     pex:   - scandir-1.10.0-cp27-cp27mu-linux_x86_64.whl
                     pex:   - zipp-0.0.0-py2-none-any.whl
                     pex:   - coverage-5.0.3-cp27-cp27mu-manylinux1_x86_64.whl
                     pex:   - traceback2-1.4.0-py2.py3-none-any.whl
                     pex:   - flaky-3.6.1-py2.py3-none-any.whl
                     pex:   - funcsigs-1.0.2-py2.py3-none-any.whl
                     pex:   - atomicwrites-1.3.0-py2.py3-none-any.whl
                     pex:   - pluggy-0.13.1-py2.py3-none-any.whl
                     pex:   - contextlib2-0.6.0.post1-py2.py3-none-any.whl
                     pex:   - wcwidth-0.1.8-py2.py3-none-any.whl
                     pex:   - importlib_metadata-1.4.0-py2.py3-none-any.whl
                     pex:   - unittest2-1.1.0-py2.py3-none-any.whl
                     pex:   - pytest-4.6.9-py2.py3-none-any.whl
                     pex:   - attrs-19.3.0-py2.py3-none-any.whl
                     pex:   - mock-3.0.5-py2.py3-none-any.whl
                     pex:   - packaging-20.0-py2.py3-none-any.whl
                     pex:   - pytest_timeout-1.3.4-py2.py3-none-any.whl
                     pex:   - pyparsing-2.4.6-py2.py3-none-any.whl
                     pex:   - pytest_cov-2.8.1-py2.py3-none-any.whl
Note that the included zipp version is zipp-0.0.0-py2-none-any.whl zipp released version 2.0.0 2 days ago which only supports python 3. Could this be related? Any recommendation for how to do further investigation?
Yes, this hit us this weekend 😕 the solution is to set this in pants.ini:
Copy code
pytest_plugins: +["zipp==1.0.0"]
FWIT, we believe the upcoming upgrade to Pex 2.x will fix this as the vendored Pip should do the right thing
I tried this but somehow didn’t work (maybe I didn’t do it properly) Let me retry.
I still see
being added the .pants.d/pyprep/requirements/CPython-2.7.15/2c00180c58220438068394d843c654e7fa7bc346/.deps
Oh try
./pants clean-all
if you haven’t done so yet. I think that 1.23.0 had an issue with fingerprinting that we fixed in 1.24.0
1.23.0 is the latest release version I can find
I will try
👍 1
Cool. For context, this was our fix today:
👍 1
Turned I had to pin zipp version in both pants.ini for pytest-plugin, but also for my test’s BUILD target. At least the issue is resolved after I pinned in both places
Huh, what do you mean by pinning the BUILD target?
probably my test has transitive dependencies to zipp too?
Huh, what do you mean by pinning the BUILD target?
Pin zipp’s version in the requirment.txt and add zipp to my BUILD target
👍 1