python-coveralls
python-coveralls copied to clipboard
Conflicting version requirements for coverage between python-coveralls and pytest-cov
The latest version of 'python-coveralls' (2.9.1, released 4/2017) requires coverage==4.0.3 (see its setup.py). The latest version of 'pytest-cov' (2.6.0, released today) requires coverage>=4.4.
This breaks the tests of several of our projects. The version conflicts are reported by pip:
...
python-coveralls 2.9.1 has requirement coverage==4.0.3, but you'll have coverage 4.5.1 which is incompatible.
...
pytest-cov 2.6.0 has requirement coverage>=4.4, but you'll have coverage 4.0.3 which is incompatible.
...
The test run finally breaks when py.test cannot load its pytest-cov plugin:
pluggy.manager.PluginValidationError: Plugin 'pytest_cov' could not be loaded: (coverage 4.0.3 (/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages), Requirement.parse('coverage>=4.4'))!
Why is it that python-coveralls needs to require exactly coverage==4.0.3? This was doomed to create such a conflict one day.
Same issue here.
As a workaround, just force the version of coverage
to be at least 4.4 by pip-installing that over the top; that seems to work with our tests. (OK, they're not thorough tests of whether this is correct, but it seems to work.)
Quick fix: pin pytest-cov to a previous version -> pytest-cov==2.5.0
Would it be possible to relax the coverage
constraint here and merely require 4.0.3
as a minimum? Any ideas as to what motivated that constraint initially?
https://github.com/z4r/python-coveralls/blob/286e98ff8d3aebc2b78659fa0dd08a575a7a7285/setup.py#L25
I had this same issue, after upgrading pip ( pip install --upgrade pip
) I didn't have the problem, not sure why this would have done anything though.
PR #67 (released in version 2.9.2) has addressed this issue by now requiring coverage>=4.4.
The issue should be closed because it has been fixed, as stated above.
As a remark for anyone who is still seeing similar symptoms:
The same symptom pluggy.manager.PluginValidationError
can also occur due to a bug in pip's dependency resolver. This can be solved by using pip >= 20.3 (will be released soon). For details, see https://pip.pypa.io/en/stable/user_guide/#resolver-changes-2020