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.

Also includes an update for doc/requirements.txt to facilitate
changes for global sphinx requirements.

Change-Id: Ic0991d3eeae018609be0ecbd43fa0b0b9f13d6ba
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
(cherry picked from commit 5c71ebd7a9)
(cherry picked from commit 7eeb144b7d)
This commit is contained in:
Stephen Finucane 2019-10-15 15:40:16 +01:00 committed by Andrii Ostapenko
parent 95b2bbeab1
commit 2a8f89b1e5
4 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,8 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
sphinxcontrib-apidoc>=0.2.0 # BSD sphinxcontrib-apidoc>=0.2.0 # BSD
sphinxcontrib-seqdiag>=0.8.4 # BSD sphinxcontrib-seqdiag>=0.8.4 # BSD
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0

View File

@ -8,7 +8,7 @@ docutils==0.14
dogpile.cache==0.6.2 dogpile.cache==0.6.2
fixtures==3.0.0 fixtures==3.0.0
flake8-docstrings==0.2.1.post1 flake8-docstrings==0.2.1.post1
flake8==2.5.5 flake8==2.6.0
Flask===1.0.2 Flask===1.0.2
Flask-RESTful===0.3.5 Flask-RESTful===0.3.5
freezegun==0.3.6 freezegun==0.3.6
@ -51,7 +51,8 @@ pymongo===3.0.2
pysaml2==4.5.0 pysaml2==4.5.0
PyJWT==1.6.1 PyJWT==1.6.1
python-keystoneclient==3.8.0 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 pytz==2013.6
requests==2.14.2 requests==2.14.2
scrypt==0.8.0 scrypt==0.8.0

View File

@ -31,7 +31,8 @@ ldap =
python-ldap>=3.0.0 # PSF python-ldap>=3.0.0 # PSF
ldappool>=2.3.1 # MPL ldappool>=2.3.1 # MPL
memcache = 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 = mongodb =
pymongo!=3.1,>=3.0.2 # Apache-2.0 pymongo!=3.1,>=3.0.2 # Apache-2.0
bandit = bandit =

View File

@ -4,7 +4,6 @@
hacking>=1.1.0,<1.2.0 # Apache-2.0 hacking>=1.1.0,<1.2.0 # Apache-2.0
pep257==0.7.0 # MIT License pep257==0.7.0 # MIT License
pycodestyle>=2.0.0 # MIT License
flake8-docstrings==0.2.1.post1 # MIT flake8-docstrings==0.2.1.post1 # MIT
bashate>=0.5.1 # Apache-2.0 bashate>=0.5.1 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0