From fc42cc6be7264e1f5bdfe201962b5e970cd08923 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 6 Jul 2018 13:39:55 +0100 Subject: [PATCH] Bump hacking to 1.1.0 hacking 1.0+ adds a couple of additional checks that are helpful as part of the transition to Python 3. However, hacking 1.1.0 incorporated flake8 2.6.x, which transitioned from pep8 to pycodestyle. Tempest provides some hacking extensions and these use pep8 imports. As things stand, projects that wish to use these hacking extensions must either constrain themselves to the same older hacking versions or install pep8 manually. Neither of these approaches is particularly attractive so instead transition to hacking 1.1.0 ourselves. This has the benefit of giving us the additional checks for Python 3. Change-Id: I09e3d2461366bb439bcb817149ce807a232acfbb --- tempest/hacking/checks.py | 8 ++++---- test-requirements.txt | 2 +- tox.ini | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py index a57a360880..20ba34eeb8 100644 --- a/tempest/hacking/checks.py +++ b/tempest/hacking/checks.py @@ -15,7 +15,7 @@ import os import re -import pep8 +import pycodestyle PYTHON_CLIENTS = ['cinder', 'glance', 'keystone', 'nova', 'swift', 'neutron', @@ -66,7 +66,7 @@ def scenario_tests_need_service_tags(physical_line, filename, def no_setup_teardown_class_for_tests(physical_line, filename): - if pep8.noqa(physical_line): + if pycodestyle.noqa(physical_line): return if 'tempest/test.py' in filename or 'tempest/lib/' in filename: @@ -161,7 +161,7 @@ def _common_service_clients_check(logical_line, physical_line, filename, if not METHOD.match(physical_line): return False - if pep8.noqa(physical_line): + if pycodestyle.noqa(physical_line): return False return True @@ -284,7 +284,7 @@ def dont_put_admin_tests_on_nonadmin_path(logical_line, physical_line, if 'tempest/api/' not in filename: return - if pep8.noqa(physical_line): + if pycodestyle.noqa(physical_line): return if not re.match(r'class .*Test.*\(.*Admin.*\):', logical_line): diff --git a/test-requirements.txt b/test-requirements.txt index e33f2079d4..196387cb75 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 mock>=2.0.0 # BSD coverage!=4.4,>=4.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index de4f1b786d..ab725489e6 100644 --- a/tox.ini +++ b/tox.ini @@ -176,7 +176,8 @@ import_exceptions = tempest.services # E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.openstack.org/#/c/36788/ # E123 skipped because it is ignored by default in the default pep8 # E129 skipped because it is too limiting when combined with other rules -ignore = E125,E123,E129 +# W504 skipped because it is overeager and unnecessary +ignore = E125,E123,E129,W504 show-source = True exclude = .git,.venv,.tox,dist,doc,*egg,build enable-extensions = H106,H203,H904