0

目前,我正在使用pants 来构建和测试我们的python2.7 包。在 pytests 目标完成后,我们开始在运行目标期间注意到以下错误。我尝试添加 constraints.txt 文件以排除它抱怨的依赖项,但错误不会停止。有没有办法在裤子构建步骤中排除这些依赖项?

./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
4

1 回答 1

0

您可以尝试通过以下方式增加详细程度:

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

然后在这里回复?

此错误可能是由几件事引起的。您是否在构建 PEX 的同一操作系统上执行 PEX?您是否还包含platforms=[...]在文件中的python_binary函数中BUILD

于 2020-02-12T13:51:43.457 回答