Upgrade default Pytest for Python3.6 and 3.7?

pytest-cov recently updated their requirements from >=3.6 to >=4.6 (see here), while the pre-installed pytest in Python3.6 and 3.7 seems to be 4.3.1 . See e.g. https://travis-ci.com/github/sjvrijn/mf2/jobs/348514594 as an example, where Python3.8 (with default pytest 5.2.1) builds just fine.

Pip doesn’t reevaluate its pytest version when pytest is listed before pytest-cov in the requirements.txt. For my repo I’ve solved the issue by adding -U to my pip install -r requirements-dev.txtline, but I probably won’t be the only one with this issue…

Requirement already satisfied: pytest in /home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages (from -r requirements-dev.txt (line 6)) (4.3.1)
[…]
pytest-cov 2.10.0 has requirement pytest>=4.6, but you’ll have pytest 4.3.1 which is incompatible.

If you specify a more recent version of Python, e.g., 3.6.10, you should get a more recent archive, which has newer tools.

1 Like

2 posts were split to a new topic: Provide a way to install the most recent Python version in a release line

Why not specify it after then as a workaround?

This looks like a problem of Pip as it doesn’t calculate the versions to install correctly. This may be addressed in Pip’s new resolver: http://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html

That would be another workaround option yes. As mentioned I chose to use pip install -U -r requirements.txt instead, which also works.

The new pip resolver should hopefully fix this problem yes, but it doesn’t change the observation that de (default) python3.6 and python3.7 have relatively old pytest versions built-in. Defaulting those specifications to the most recent subrelease would be very helpful for that already too :slight_smile:

Imprint