https://pantsbuild.org/ logo
#general
Title
# general
a

agreeable-microphone-98219

10/19/2022, 10:42 AM
I’m trying to enable coverage for python with pants however I’m stuck. 1. When I set
use_coverage = true
in
pants.toml
it complains:
[pytest].extra_requirements is missing pytest-cov, which is needed to collect coverage data.
2. Since
pytest-cov
is a new
extra_requirement
for
pytest
, I have to run
./pants generate-lockfiles --resolve=pytest
. Otherwise, it complains with
InvalidLockfileError
. 3. However, when I run
./pants generate-lockfiles --resolve=pytest
, pants does not generate hashes for some dependencies. 4. So when I run
./pants test ::
it starts to complain:
Copy code
ProcessExecutionFailure: Process 'Building pytest.pex from src/python/tests/lockfile_pytest.txt' failed with exit code 1.
stdout:

stderr:
ERROR: Hashes are required in --require-hashes mode, but they are missing from some requirements. Here is a list of those requirements along with the hashes their downloaded archives actually had. Add lines like these to your requirements files to prevent tampering. (If you did not enable --require-hashes manually, note that it turns on automatically when any package has a hash.)
any ideas?
7 Views