Upgrade hacking

Added some pep exclusion to tox
Change in test the import from pep8 to pycodestyle
needed by the new version of hacking

Change-Id: I61fca207f375f3d43241da59d7c9213ac9401a21
This commit is contained in:
Eyal 2019-08-06 15:11:03 +03:00
parent 1a2ff63733
commit d8a127abe2
4 changed files with 10 additions and 9 deletions

View File

@ -26,12 +26,12 @@ eventlet==0.20.0
extras==1.0.0
fasteners==0.7.0
fixtures==3.0.0
flake8==2.5.5
flake8==2.6.2
future==0.16.0
futurist==1.2.0
gnocchiclient==3.3.1
greenlet==0.4.13
hacking==0.12.0
hacking==1.1.0
httplib2==0.9.1
idna==2.6
imagesize==0.7.1
@ -97,6 +97,7 @@ positional==1.2.1
prettytable==0.7.2
pyasn1==0.1.8
pycadf==1.1.0
pycodestyle==2.3.1
pycparser==2.18
pyflakes==0.8.1
Pygments==2.2.0

View File

@ -13,7 +13,7 @@
import textwrap
import mock
import pep8
import pycodestyle
from mistral.hacking import checks
from mistral.tests.unit import base
@ -36,13 +36,13 @@ class BaseLoggingCheckTest(base.BaseTest):
# We are patching pep8 so that only the check under test is actually
# installed.
@mock.patch('pep8._checks',
@mock.patch('pycodestyle._checks',
{'physical_line': {}, 'logical_line': {}, 'tree': {}})
def run_check(self, code, checker, filename=None):
pep8.register_check(checker)
pycodestyle.register_check(checker)
lines = textwrap.dedent(code).strip().splitlines(True)
checker = pep8.Checker(filename=filename, lines=lines)
with mock.patch('pep8.StandardReport.get_file_results'):
checker = pycodestyle.Checker(filename=filename, lines=lines)
with mock.patch('pycodestyle.StandardReport.get_file_results'):
checker.check_all()
checker.report._deferred_print.sort()

View File

@ -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
coverage!=4.4,>=4.0 # Apache-2.0
croniter>=0.3.4 # MIT License

View File

@ -97,7 +97,7 @@ whitelist_externals = rm
#Skip PEP257 violation.
[flake8]
ignore = D100,D101,D102,D103,D104,D105,D200,D203,D202,D204,D205,D208,D400,D401
ignore = D100,D101,D102,D103,D104,D105,D200,D203,D202,D204,D205,D208,D400,D401,E402,W503,E731
show-source = true
builtins = _
# [H106] Don't put vim configuration in source files.