<#21851 Adding `pytest-cov` dependency to project ...
# github-notifications
c
#21851 Adding `pytest-cov` dependency to project breaks Pants commands Issue created by ruslan-roboto Describe the bug We recently added
pytest-cov
to our repo to measure test coverage. For some engineers on the team working specifically on Mac laptops, this causes a 100%-repro failure when running any Pants command, e.g. `pants fmt ::`:
Copy code
10:09:05.55 [INFO] Completed: Building black.pex
10:09:05.56 [ERROR] 1 Exception encountered:

Engine traceback:
  in `fmt` goal

ProcessExecutionFailure: Process 'Building black.pex' failed with exit code 1.
stdout:

stderr:
Invalid version: '3.10.16+'

Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
Other issues on the Internet indicate that
3.10.16+
is an untagged CPython version string, but rerunning the command with
--print-stacktrace -ldebug
didn't indicate to me where this version gets picked up from. Our project uses pyenv, and
.python_version
is set to
3.10
.
python --version
returns
3.10.15
for me. I've tried: • running with
--no-pantsd
and
--no-local-cache
- no effect • playing around with the versions of
pytest
and
pytest-cov
- no effect, but whenever I regenerate our lockfile, the
pytest-cov
dependency is shown in red in the update summary, and I don't know what that means • moving pytest and pytest-cov to their own resolve as per some suggestions on the Pants website - no effect Pants version From our `pants.toml`: [GLOBAL] pants_version = "2.21.0" The issue repros if I change this to 2.22 or 2.23, haven't tried 2.24. OS This repros on MacOS, but not on Linux. Also anecdotally not on all MacOS laptops within the team. I'm on MacOS Sonoma 14.7 Additional info Add any other information about the problem here, such as attachments or links to gists, if relevant. Output of
python -VV
run from the root of our repo:
Python 3.10.15 (main, Jan 16 2025, 131427) [Clang 16.0.0 (clang-1600.0.26.3)]
pantsbuild/pants