high-yak-85899
02/09/2022, 12:33 AMpytest
? More details in thread23:58:33.09 [ERROR] Completed: Run Pytest - astranis-python/<REDACTED>:tests failed (exit code 1).
Traceback (most recent call last):
File "/tmp/process-executionzSZxZH/.cache/pex_root/venvs/3ad0f8096ed09d4b74b6393f05ab9a5d3030620e/ca99f6b407a13d64ad0fe4d244f95a445623f0e3/pex", line 160, in <module>
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pytest'
hundreds-father-404
02/09/2022, 12:37 AM./pants test
it looks like. That is bewildering.
Are you using the default tool lockfile or a custom one (set by [pytest].lockfile
)?high-yak-85899
02/09/2022, 12:39 AM[pytest]
extra_requirements = ["pytest-cov>=2.12,!=2.12.1,<3.1", "pytest-timeout"]
# Pants generates this lock file for us (when we command it) but we still must
# point to it
lockfile = "pytest_requirements.lock"
hundreds-father-404
02/09/2022, 12:43 AMpytest
as a python_requirement
target, e.g. in a requirements.txt
? That's a common (awkward) pattern to define it both in [pytest].version
and via python_requirement
target so that things like MyPy can resolve Pytest. https://github.com/pantsbuild/pants/issues/12449high-yak-85899
02/09/2022, 12:46 AMhundreds-father-404
02/09/2022, 12:47 AM[pytest].version
?high-yak-85899
02/09/2022, 12:55 AMhundreds-father-404
02/09/2022, 12:57 AM--pex-path
, and I believe it simply goes with the first version of Pytest encountered iirc. If possible, it may be fruitful to sync those two versions. (Ack that we really need https://github.com/pantsbuild/pants/issues/12449)