Skip to content

Commit 20769cd

Browse files
committed
Fix lower-constraints job
pip 20.3 finally includes a proper dependency resolver. Its use is causing the following error messages on the lower-constraints job: ERROR: Cannot install ... because these package versions have conflicting dependencies. The conflict is caused by: bandit 1.1.0 depends on PyYAML>=3.1.0 cliff 3.4.0 depends on PyYAML>=3.12 openstacksdk 0.52.0 depends on PyYAML>=3.13 Bump our lower constraint for PyYAML to resolve this issue. With that resolved, we see a new issue: ERROR: Could not find a version that satisfies the requirement cryptography>=2.7 (from openstacksdk) ERROR: No matching distribution found for cryptography>=2.7 This is less self-explanatory but looking at the lower-constraints for openstacksdk 0.52.0 shows a dependency on cryptography 2.7 [1], meaning we need to bump this also. Next up, flake8-import-order seems to cause the dependency resolver to go nuts, eventually ending with the following error message in a Python 3.6 environment: Using cached enum34-1.1.2.zip (49 kB) ERROR: Command errored out with exit status 1: command: ... cwd: ... Complete output (9 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File ".../lib/python3.6/site-packages/setuptools/__init__.py", line 7, in <module> import setuptools.distutils_patch # noqa: F401 File ".../lib/python3.6/site-packages/setuptools/distutils_patch.py", line 9, in <module> import re File "/usr/lib64/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' ---------------------------------------- A quick Google suggests this is because the enum34 package is not complete [2]. We shouldn't even be using it since our base virtualenv should at least use Python 3.6, but I guess some dependency doesn't properly restrict the dependency to <= Python 3.4. This is moved from 'test-requirements.txt' to 'tox.ini' since we don't need to use our constraints machinery for linters. Finally, the versions of bandit and hacking that pip is bringing in both requires in a newer version of babel, which in turn requires a new version of pytz. Collecting hacking>=2.0.0 ... ERROR: Cannot install oslo.i18n because these package versions have conflicting dependencies. The conflict is caused by: babel 2.9.0 depends on pytz>=2015.7 babel 2.8.1 depends on pytz>=2015.7 babel 2.8.0 depends on pytz>=2015.7 babel 2.7.0 depends on pytz>=2015.7 Seeing as we shouldn't be tracking bandit in lower-constraints, I'm not sure why we're want to bump these dependencies for just that. As above, we move these dependencies out of 'test-requirements' and into 'tox.ini' since we can do that for linters. [1] https://opendev.org/openstack/openstacksdk/src/tag/0.52.0/requirements.txt#L19 [2] iterative/dvc#1995 (comment) Change-Id: I8ec738fbcabc8d8553db79a876e5592576cd18fa Signed-off-by: Stephen Finucane <[email protected]>
1 parent fe98069 commit 20769cd

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lower-constraints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cliff==3.4.0
99
cmd2==0.8.0
1010
contextlib2==0.4.0
1111
coverage==4.0
12-
cryptography==2.1
12+
cryptography==2.7
1313
ddt==1.0.1
1414
debtcollector==1.2.0
1515
decorator==4.4.1
@@ -105,7 +105,7 @@ python-watcherclient==2.5.0
105105
python-zaqarclient==1.0.0
106106
python-zunclient==3.6.0
107107
pytz==2013.6
108-
PyYAML==3.12
108+
PyYAML==3.13
109109
repoze.lru==0.7
110110
requests-mock==1.2.0
111111
requests==2.14.2

test-requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
# The order of packages is significant, because pip processes them in the order
22
# of appearance. Changing the order has an impact on the overall integration
33
# process, which may cause wedges in the gate later.
4-
hacking>=2.0.0 # Apache-2.0
54
coverage!=4.4,>=4.0 # Apache-2.0
65
fixtures>=3.0.0 # Apache-2.0/BSD
7-
flake8-import-order>=0.13 # LGPLv3
86
oslotest>=3.2.0 # Apache-2.0
97
requests>=2.14.2 # Apache-2.0
108
requests-mock>=1.2.0 # Apache-2.0
119
stestr>=1.0.0 # Apache-2.0
1210
testtools>=2.2.0 # MIT
1311
tempest>=17.1.0 # Apache-2.0
1412
osprofiler>=1.4.0 # Apache-2.0
15-
bandit!=1.6.0,>=1.1.0 # Apache-2.0
1613
wrapt>=1.7.0 # BSD License
1714
ddt>=1.0.1 # MIT

tox.ini

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ commands =
2828
{toxinidir}/tools/fast8.sh
2929

3030
[testenv:pep8]
31+
deps =
32+
hacking>=2.0.0
33+
bandit!=1.6.0,>=1.1.0
34+
flake8-import-order>=0.13 # LGPLv3
3135
commands =
32-
flake8
33-
bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101
36+
flake8
37+
bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101
3438

3539
[testenv:bandit]
3640
# This command runs the bandit security linter against the openstackclient

0 commit comments

Comments
 (0)