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
diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py
index a57a360..20ba34e 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 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 @@
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 @@
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 e33f207..196387c 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 de4f1b7..ab72548 100644
--- a/tox.ini
+++ b/tox.ini
@@ -176,7 +176,8 @@
# 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