0

Currently, I am using pants to build and test our python2.7 packages. We started noticing the following error during run goal after pytests goal is completed. I tried adding constraints.txt file to exclude the dependencies its complaining about, but the error wouldn't stop. Is there a way to exclude these dependencies during the pants build step?

./pants test.pytest --coverage=auto tests/python/abcd/test/xyz 

[pytest]
[cache] 
No cached artifacts for 1 target.
Invalidated 1 target.
[run]
Failed to execute PEX file, missing compatible dependencies for:
 importlib-metadata
 zipp

No .coverage file was found! Skipping coverage reporting.
                   tests/python/abcd/test/xyz                                      .....   SUCCESS

FAILURE
Ganga
  • 883
  • 12
  • 24

1 Answers1

0

Can you try increasing the verbosity with:

PEX_VERBOSE=9 ./pants test.pytest --coverage=auto tests/python/abcd/test/xyz

and then respond here?

This error can be caused by a couple of things. Are you executing the PEX on the same operating system that the PEX was built on? Do you also include platforms=[...] in your python_binary function in your BUILD file?

Jordan Gillard
  • 301
  • 1
  • 5
  • 14
  • here is the issue reported in PEX community with detailed stack trace - https://github.com/pantsbuild/pex/issues/871, Unfortunately PEX verbose exceeds start ackoverflow limit – Ganga Feb 15 '20 at 04:36
  • Also the error is happening during pytest and not in python binary. I tried the approach explained in https://stackoverflow.com/questions/34979100/pants-includes-os-x-specific-python-wheels, but that doesnt help – Ganga Feb 15 '20 at 04:42
  • Has your `.pants` file changed? Is this error happening locally or in CI on a different OS? – Jordan Gillard Feb 16 '20 at 08:41
  • No changes to the pants ini file was made. We did not add any new dependencies. It started breaking all of a sudden. It is happening on both MacOS and Linux environments – Ganga Feb 18 '20 at 04:48