From 80dfb3b023a268d6d6204220665c2cf43eac66df Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Fri, 4 May 2018 11:18:22 -0600 Subject: pycodestyle: Fix deprecated string literals, move away from flake8. Fix remaining pycodesytle warnings related to invalid string literals introduced in more recent pycodeflakes versions https://bugs.python.org/issue27364 . Also stop using flake8 in tox as it is incompatible with newer versions of pyflakes. Instead we now add tox environments for pycodestyle and pyflakes individually. Set the versions in both pycodestyle and pyflakes to the currently available versions. --- tox.ini | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'tox.ini') diff --git a/tox.ini b/tox.ini index 818ade3d..2fb3209d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3, flake8, xenial, pylint +envlist = py27, py3, xenial, pycodestyle, pyflakes, pylint recreate = True [testenv] @@ -7,14 +7,11 @@ commands = python -m nose {posargs:tests/unittests cloudinit} setenv = LC_ALL = en_US.utf-8 -[testenv:flake8] +[testenv:pycodestyle] basepython = python3 deps = - pycodestyle==2.3.1 - pyflakes==1.5.0 - flake8==3.3.0 - hacking==0.13.0 -commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/} + pycodestyle==2.4.0 +commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/} # https://github.com/gabrielfalcao/HTTPretty/issues/223 setenv = @@ -118,6 +115,11 @@ deps = commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/} deps = pycodestyle +[testenv:pyflakes] +commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/} +deps = + pyflakes==1.6.0 + [testenv:tip-pyflakes] commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/} deps = pyflakes -- cgit v1.2.3 From 4c568f220b65dbc1af822ccfa0f31638fed02d83 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Thu, 7 Jun 2018 13:45:09 -0600 Subject: tests: ordered tox dependencies for pylxd install The pylxd project has a setup.py which defines install dependencies. Those sub-dependendencies include pbr and requests which in turn have package version conflicts. Since tox doesn't order dependencies installed, serially install pinned urllib3 at 1.22 which supports both pbr deps and requests deps of pylxd. --- integration-requirements.txt | 5 ----- tox.ini | 9 ++++++++- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'tox.ini') diff --git a/integration-requirements.txt b/integration-requirements.txt index df3a73ef..030c163b 100644 --- a/integration-requirements.txt +++ b/integration-requirements.txt @@ -11,10 +11,5 @@ boto3==1.5.9 # ssh communication paramiko==2.4.0 -# lxd backend -# 04/03/2018: enables use of lxd 3.0 -git+https://github.com/lxc/pylxd.git@1a85a12a23401de6e96b1aeaf59ecbff2e88f49d - - # finds latest image information bzr+lp:simplestreams diff --git a/tox.ini b/tox.ini index 2fb3209d..fbc2c880 100644 --- a/tox.ini +++ b/tox.ini @@ -134,7 +134,14 @@ deps = [testenv:citest] basepython = python3 -commands = {envpython} -m tests.cloud_tests {posargs} +commands = + # 06/07/2018: enables use of lxd 3.0 and pre-pip install urllib3==1.22 + # to avoid contextual version conflicts with pylxd's setup_requires of + # pbr which installs latest urllib3 and requests which requires < 1.23. + # Install ordered requirements as pylxd has sub-dep conflicts. + pip3 install urllib3==1.22 + pip3 install git+https://github.com/lxc/pylxd.git@1a85a12a23401de6e96b1aeaf59ecbff2e88f49d + {envpython} -m tests.cloud_tests {posargs} passenv = HOME deps = -r{toxinidir}/integration-requirements.txt -- cgit v1.2.3 From fc23ccc91307c81dd8e428465eb56efbd539267e Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 8 Jun 2018 10:39:12 -0600 Subject: tests: remove pip install workarounds for pylxd, take upstream fix. pylxd upstream provided a fix for the issue we were seeing, so we can take that fix now rather than having our workarounds to order pip installs. The test is that this continues to work: rm -Rf .tox/citest tox -c tox.ini --recreate --notest -e citest --- integration-requirements.txt | 5 +++++ tox.ini | 9 +-------- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'tox.ini') diff --git a/integration-requirements.txt b/integration-requirements.txt index 030c163b..e5bb5b28 100644 --- a/integration-requirements.txt +++ b/integration-requirements.txt @@ -11,5 +11,10 @@ boto3==1.5.9 # ssh communication paramiko==2.4.0 +# lxd backend +# 04/03/2018: enables use of lxd 3.0 +git+https://github.com/lxc/pylxd.git@4b8ab1802f9aee4eb29cf7b119dae0aa47150779 + + # finds latest image information bzr+lp:simplestreams diff --git a/tox.ini b/tox.ini index fbc2c880..2fb3209d 100644 --- a/tox.ini +++ b/tox.ini @@ -134,14 +134,7 @@ deps = [testenv:citest] basepython = python3 -commands = - # 06/07/2018: enables use of lxd 3.0 and pre-pip install urllib3==1.22 - # to avoid contextual version conflicts with pylxd's setup_requires of - # pbr which installs latest urllib3 and requests which requires < 1.23. - # Install ordered requirements as pylxd has sub-dep conflicts. - pip3 install urllib3==1.22 - pip3 install git+https://github.com/lxc/pylxd.git@1a85a12a23401de6e96b1aeaf59ecbff2e88f49d - {envpython} -m tests.cloud_tests {posargs} +commands = {envpython} -m tests.cloud_tests {posargs} passenv = HOME deps = -r{toxinidir}/integration-requirements.txt -- cgit v1.2.3