python-coveralls icon indicating copy to clipboard operation
python-coveralls copied to clipboard

Conflicting version requirements for coverage between python-coveralls and pytest-cov

Open andy-maier opened this issue 6 years ago • 7 comments

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.

andy-maier avatar Sep 03 '18 23:09 andy-maier

Same issue here.

inkhey avatar Sep 05 '18 10:09 inkhey

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.)

dkfellows avatar Sep 07 '18 11:09 dkfellows

Quick fix: pin pytest-cov to a previous version -> pytest-cov==2.5.0

carlomazzaferro avatar Nov 21 '18 01:11 carlomazzaferro

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

jakirkham avatar Dec 23 '18 00:12 jakirkham

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.

stoltzmaniac avatar Jan 08 '19 00:01 stoltzmaniac

PR #67 (released in version 2.9.2) has addressed this issue by now requiring coverage>=4.4.

andy-maier avatar Oct 31 '19 02:10 andy-maier

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

MaxGaukler avatar Sep 30 '20 09:09 MaxGaukler