Update hacking version

Use latest release 1.1.0 and compatible changes w.r.t pep8

It's worth noting that the pep8 package has been renamed to
pycodestyle. New hacking packages no longer install the old pep8
package automatically.

Change-Id: Ibbad8b42188ade597d9a3032389e930c2f5fe2d0
This commit is contained in:
jacky06 2019-03-06 22:16:11 +08:00 committed by Lucian Petrut
parent 7ed1f4db45
commit ec959ea8bc
4 changed files with 13 additions and 13 deletions

View File

@ -10,9 +10,9 @@ eventlet==0.18.2
extras==1.0.0
fasteners==0.7.0
fixtures==3.0.0
flake8==2.5.5
flake8==2.6.0
greenlet==0.4.10
hacking==0.12.0
hacking==1.1.0
imagesize==0.7.1
iso8601==0.1.11
Jinja2==2.10

View File

@ -18,7 +18,7 @@ import os
import textwrap
import mock
import pep8
import pycodestyle
from os_win._hacking import checks
from os_win.tests.unit import test_base
@ -58,20 +58,20 @@ class HackingTestCase(test_base.OsWinBaseTestCase):
"""
def _run_check(self, code, checker, filename=None):
# We are patching pep8 so that only the check under test is actually
# installed.
# We are patching pycodestyle (pep8) so that only the check under test
# is actually installed.
mock_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}}
with mock.patch('pep8._checks', mock_checks):
pep8.register_check(checker)
with mock.patch('pycodestyle._checks', mock_checks):
pycodestyle.register_check(checker)
lines = textwrap.dedent(code).strip().splitlines(True)
checker = pep8.Checker(filename=filename, lines=lines)
checker = pycodestyle.Checker(filename=filename, lines=lines)
# NOTE(sdague): the standard reporter has printing to stdout
# as a normal part of check_all, which bleeds through to the
# test output stream in an unhelpful way. This blocks that
# printing.
with mock.patch('pep8.StandardReport.get_file_results'):
with mock.patch('pycodestyle.StandardReport.get_file_results'):
checker.check_all()
checker.report._deferred_print.sort()
return checker.report._deferred_print

View File

@ -23,12 +23,12 @@ import sys
import threading
import time
if sys.platform == 'win32':
import wmi
from oslo_log import log as logging
from oslo_utils import reflection
if sys.platform == 'win32':
import wmi
LOG = logging.getLogger(__name__)

View File

@ -2,7 +2,7 @@
# 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
ddt>=1.0.1 # MIT