diff options
author | Stephen Finucane <sfinucan@redhat.com> | 2019-10-15 15:40:16 +0100 |
---|---|---|
committer | Colleen Murphy <colleen.murphy@suse.com> | 2020-05-14 06:56:06 -0700 |
commit | 7eeb144b7dbca29cb30cf65bb740227f4c4c7a55 (patch) | |
tree | 313d047a34e1a5623185d66545afe5f17457c27f | |
parent | 40cbb7bebd50276412daa1981ff5a7c7b3b899a5 (diff) | |
download | keystone-7eeb144b7dbca29cb30cf65bb740227f4c4c7a55.tar.gz |
Stop explicitly requiring pycodestyle
pip doesn't have a dependency resolver. Instead, it "simply uses the
first specification it finds for a project." [1] In Train, keystone
switched from hacking 0.12.x/0.13.x to hacking 1.1.x [2]. That change
explicitly added a pycodestyle dependency for reasons that aren't
entirely clear to me, but pip's broken dependency resolution leads to
the below funkiness when trying to install the dependencies.
ERROR: flake8 2.6.2 has requirement pycodestyle<2.1,>=2.0, but you'll have pycodestyle 2.5.0 which is incompatible.
As seen below, this can be easily reproduced and seems to happen because
pip doesn't go further than one level of dependencies, meaning it knows
about the dependency on flake8<2.7.0,>=2.6.0 from hacking, but not the
dependency on pycodestyle<2.1,>=2.0 that this in-turn introduces.
$ virtualenv venv
$ source venv/bin/activate
$ (venv) cat requirements.txt
hacking>=1.1.0,<1.2.0 # Apache-2.0
pycodestyle>=2.0.0 # MIT License
$ pip install -r requirements-new.txt
Collecting hacking<1.2.0,>=1.1.0
Using cached ...
Collecting pycodestyle>=2.0.0
Using cached ...
Collecting six>=1.10.0
Using cached ...
Collecting flake8<2.7.0,>=2.6.0
Using cached ...
Collecting pbr!=2.1.0,>=2.0.0
Using cached ...
Collecting mccabe<0.6,>=0.2.1
Using cached ...
Collecting pyflakes!=1.2.0,!=1.2.1,!=1.2.2,<1.3,>=0.8.1
Using cached ...
ERROR: flake8 2.6.2 has requirement pycodestyle<2.1,>=2.0, but you'll have pycodestyle 2.5.0 which is incompatible.
Installing collected packages: six, pycodestyle, mccabe, pyflakes, flake8, pbr, hacking
Successfully installed flake8-2.6.2 hacking-1.1.0 mccabe-0.5.3 pbr-5.4.3 pycodestyle-2.5.0 pyflakes-1.2.3 six-1.12.0
The solution is simple: stop explicitly requiring this dependency and
instead rely on flake8 bringing it in.
[1] https://pip.pypa.io/en/stable/user_guide/#requirements-files
[2] I3fc591e09c1e25a3bd2a3922880772ea9617f1e3
This cherry-pick includes an update to setup.cfg to align the
python-memcached version with global requirements.
Change-Id: Ic0991d3eeae018609be0ecbd43fa0b0b9f13d6ba
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
(cherry picked from commit 5c71ebd7a92d25df83e2e7cc5fad9990e9eebbf5)
-rw-r--r-- | lower-constraints.txt | 5 | ||||
-rw-r--r-- | setup.cfg | 3 | ||||
-rw-r--r-- | test-requirements.txt | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lower-constraints.txt b/lower-constraints.txt index 2e061fea6..bf8470e17 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -8,7 +8,7 @@ docutils==0.14 dogpile.cache==0.6.2 fixtures==3.0.0 flake8-docstrings==0.2.1.post1 -flake8==2.5.5 +flake8==2.6.0 Flask===1.0.2 Flask-RESTful===0.3.5 freezegun==0.3.6 @@ -51,7 +51,8 @@ pymongo===3.0.2 pysaml2==4.5.0 PyJWT==1.6.1 python-keystoneclient==3.8.0 -python-memcached===1.56 +python-memcached==1.56;python_version=='2.7' +python-memcached==1.58;python_version>='3.4' pytz==2013.6 requests==2.14.2 scrypt==0.8.0 @@ -31,7 +31,8 @@ ldap = python-ldap>=3.0.0 # PSF ldappool>=2.3.1 # MPL memcache = - python-memcached>=1.56 # PSF + python-memcached>=1.56:python_version=='2.7' # PSF + python-memcached>=1.58:python_version>='3.4' # PSF mongodb = pymongo!=3.1,>=3.0.2 # Apache-2.0 bandit = diff --git a/test-requirements.txt b/test-requirements.txt index a86a1fa44..6cdc34d31 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,6 @@ hacking>=1.1.0,<1.2.0 # Apache-2.0 pep257==0.7.0 # MIT License -pycodestyle>=2.0.0 # MIT License flake8-docstrings==0.2.1.post1 # MIT bashate>=0.5.1 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0 |