pytest: more-itertools 6.0.0 release breaks pytest 4.2
We are seeing issues with new installations of pytest-4.2, as it pulls in more-itertools-6.0.0 (which was released about 2 hours ago at the time of writing this issue).
Is there any way we can lock in pytest-4.2 to use more-itertools-5.0.0 to maintain the python 2.7 compatability?
Here are the errors we are seeing with pytest-4.2 and more-itertools-6.0.0:
12-Feb-2019 02:48:58 | File "/usr/local/lib/python2.7/dist-packages/more_itertools/more.py", line 329
-- | --
12-Feb-2019 02:48:58 | def _collate(*iterables, key=lambda a: a, reverse=False):
12-Feb-2019 02:48:58 | ^
12-Feb-2019 02:48:58 | SyntaxError: invalid syntax
And here is a link to more-itertools release history, indicating that python 2.7 is not supported with more-itertools-6.0.0: https://pypi.org/project/more-itertools/6.0.0/
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 31 (15 by maintainers)
Links to this issue
Commits related to this issue
- Constrain more_itertools for Python 2.7 compatibility Fixes #4772, #4770. — committed to sambrightman/pytest by deleted user 5 years ago
- Add CHANGELOG entry for #4770 — committed to sambrightman/pytest by deleted user 5 years ago
- Pinned more_itertools in gremlin_python more_itertools is a downstream depepency of pytest and a recent upgrade to it has now broken pytest: https://github.com/pytest-dev/pytest/issues/4770 CTR — committed to apache/tinkerpop by spmallette 5 years ago
- Freeze more-itertools version for centOS tests more-itertools is a pytest dependency. It dropped python 2 support since version 6.0.0. New pip versions will parse the requires_python metadata and avo... — committed to athos-ribeiro/atomic-reactor by deleted user 5 years ago
- Unified command execution in Docker containers. Also adds a hotfix for a broken test execution based on an issue with a used library: https://github.com/pytest-dev/pytest/issues/4770 Change-Id: I54a... — committed to sonata-nfv/son-emu by deleted user 5 years ago
- Pin pytest version to avoid induced breakage from more-itertools transitive dep (#7238) ### Problem A floating transitive dependency of pytest, `more-itertools`, dropped support for python 2 in it... — committed to pantsbuild/pants by cosmicexplorer 5 years ago
- Freeze more-itertools version for centOS tests more-itertools is a pytest dependency. It dropped python 2 support since version 6.0.0. New pip versions will parse the requires_python metadata and avo... — committed to containerbuildsystem/atomic-reactor by deleted user 5 years ago
- Update pytest to 4.2.1 This PR updates [pytest](https://pypi.org/project/pytest) from **4.2.0** to **4.2.1**. <details> <summary>Changelog</summary> ### 4.2.1 ``` ===============... — committed to mozilla-services/tecken by pyup-bot 5 years ago
- Centos CI docker image: Upgrade pytest to 4.2.1 Newly build Centos CI docker image will fail due to issue: https://github.com/pytest-dev/pytest/issues/4770 Upgrade the version to 4.2.1 fix this ... — committed to cathay4t/nmstate by cathay4t 5 years ago
- Centos CI docker image: Upgrade pytest to 4.2.1 Newly build Centos CI docker image will fail due to this issue: https://github.com/pytest-dev/pytest/issues/4770 Upgrade the version to 4.2.1 to f... — committed to tyll/nmstate by cathay4t 5 years ago
- Centos CI docker image: Upgrade pytest to 4.2.1 Newly build Centos CI docker image will fail due to this issue: https://github.com/pytest-dev/pytest/issues/4770 Upgrade the version to 4.2.1 to f... — committed to nmstate/nmstate by cathay4t 5 years ago
- Pin pytest version to avoid induced breakage from more-itertools transitive dep (#7238) ### Problem A floating transitive dependency of pytest, `more-itertools`, dropped support for python 2 in it... — committed to pantsbuild/pants by cosmicexplorer 5 years ago
- facilitate python setup.py test; upgrade pytest to work around more-itertools issue Issue: https://github.com/pytest-dev/pytest/issues/4770 Resolution: https://github.com/pytest-dev/pytest/pull/4774 — committed to databio/pypiper by vreuter 5 years ago
- Merge #61 61: Update pytest to 4.3.0 r=rehandalal a=pyup-bot This PR updates [pytest](https://pypi.org/project/pytest) from **4.2.0** to **4.3.0**. <details> <summary>Changelog</summary> ... — committed to rehandalal/therapist by bors[bot] 5 years ago
- Merge #1743 #1744 1743: Update dependency webpack to v4.29.5 r=mythmon a=renovate[bot] This PR contains the following updates: | Package | Type | Update | Change | References | |---|---|---|---|---... — committed to mozilla/normandy by bors[bot] 5 years ago
- upgrading pip on travis due to https://github.com/pytest-dev/pytest/issues/4770 — committed to schandrika/volttron by schandrika 5 years ago
- upgrading pip on travis due to https://github.com/pytest-dev/pytest/issues/4770 — committed to schandrika/volttron by schandrika 5 years ago
- constraining version of more-itertools due to https://github.com/pytest-dev/pytest/issues/4770. latest version of pytest has fixed this https://github.com/pytest-dev/pytest/pull/4774 — committed to schandrika/volttron by schandrika 5 years ago
- constraining version of more-itertools due to https://github.com/pytest-dev/pytest/issues/4770. latest version of pytest has fixed this https://github.com/pytest-dev/pytest/pull/4774 — committed to schandrika/volttron by schandrika 5 years ago
- Squashed commit of the following: commit efaae09a5df0f4de37c16ba5b1d2f29c2fa5bd52 Author: Eric Arellano <ericarellano@me.com> Date: Tue Feb 26 23:41:55 2019 -0700 Add debugging to release.sh f... — committed to Eric-Arellano/pants by Eric-Arellano 5 years ago
Please update your
pip
!more-itertools==6.0.0
does set therequires_python
metadata, so up-to-date versions ofpip
will not attempt to install it on old versions of Python.More generally, this isn’t actually a pytest issue, and our only “fix” would be to prevent the upgrade for Python 3 users. Remember, Python 2 is end-of-life at the end of 2019, and Pytest will drop support at that time.
I’m leaving this open for now so others find the issue, but the only solution is
pip install --upgrade pip
.I locked
more-itertools==5.0.0
in my project’s requirements.txt 😃 We are using pip 8.x, facing the same issueI get the same error as @tayalakansh: pip detects the python version mismatch and then fails, instead of installing the last compatible version. So it’s a cleaner error than OP, but the result (you can’t use pytest with python2 currently) is the same:
Fixed, a workaround was implemented in #4774 and will be released in 4.2.1. 👍
Might I ask why pytest doesn’t pin specific versions of requirements? Having installations randomly picking up new versions of dependencies makes for some annoying issues.
If you are running your own devpi-server you need to upgrade to 4.7 or newer to support ‘requires_python’ Then it will give you the 5.0.0 package without having to ask for it specifically. Or you can switch to go directly to pypi, then it should also work
https://pypi.org/project/devpi-server/