Transition to flake8 2.6.x
flake8 2.6.x performed the conversion to pycodestyle (which is the new name of pep8). Remove the explicit dependencies of hacking as flake8 is going to pull in mccabe, pyflakes and pycodestyle in the versions that are needed. Change-Id: I12b5e114c5c6783e9da5cca2818ac9266a00fc87
This commit is contained in:
parent
0f47b1076a
commit
24d7eb6a40
@ -15,14 +15,14 @@
|
||||
|
||||
"""OpenStack HACKING file compliance testing
|
||||
|
||||
Built as a sets of pep8 checks using flake8.
|
||||
Built as a sets of pycodestyle checks using flake8.
|
||||
"""
|
||||
|
||||
import gettext
|
||||
import sys
|
||||
|
||||
import pbr.util
|
||||
import pep8
|
||||
import pycodestyle
|
||||
|
||||
from hacking import config
|
||||
|
||||
@ -127,8 +127,8 @@ class GlobalCheck(object):
|
||||
|
||||
Store in a global registry the list of checks we've run. If we have
|
||||
run that one before, just skip doing anything the subsequent times.
|
||||
This way, since pep8 is file/line based, we don't wind up re-running
|
||||
a check on a git commit message over and over again.
|
||||
This way, since pycodestyle is file/line based, we don't wind
|
||||
up re-running a check on a git commit message over and over again.
|
||||
"""
|
||||
if self.name and self.name not in self.__class__._has_run:
|
||||
self.__class__._has_run.add(self.name)
|
||||
@ -154,11 +154,11 @@ class ProxyChecks(GlobalCheck):
|
||||
for check_path in set(local_check):
|
||||
if check_path.strip():
|
||||
checker = pbr.util.resolve_name(check_path)
|
||||
pep8.register_check(checker)
|
||||
pycodestyle.register_check(checker)
|
||||
|
||||
local_check_fact = CONF.get('local-check-factory')
|
||||
if local_check_fact:
|
||||
factory = pbr.util.resolve_name(local_check_fact)
|
||||
factory(pep8.register_check)
|
||||
factory(pycodestyle.register_check)
|
||||
|
||||
sys.path.pop()
|
||||
|
@ -17,7 +17,8 @@
|
||||
import re
|
||||
|
||||
from flake8 import engine
|
||||
import pep8
|
||||
import pycodestyle
|
||||
|
||||
import pkg_resources
|
||||
import six
|
||||
import testscenarios
|
||||
@ -36,7 +37,7 @@ class HackingTestCase(hacking.tests.TestCase):
|
||||
|
||||
scenarios = file_cases
|
||||
|
||||
def test_pep8(self):
|
||||
def test_pycodestyle(self):
|
||||
|
||||
# NOTE(jecarey): Add tests marked as off_by_default to enable testing
|
||||
turn_on = set(['H106', 'H203', 'H904', 'H204', 'H205', 'H210'])
|
||||
@ -44,9 +45,9 @@ class HackingTestCase(hacking.tests.TestCase):
|
||||
turn_on.update(self.options.select)
|
||||
self.options.select = tuple(turn_on)
|
||||
|
||||
report = pep8.BaseReport(self.options)
|
||||
checker = pep8.Checker(lines=self.lines, options=self.options,
|
||||
report=report)
|
||||
report = pycodestyle.BaseReport(self.options)
|
||||
checker = pycodestyle.Checker(lines=self.lines, options=self.options,
|
||||
report=report)
|
||||
checker.check_all()
|
||||
self.addDetail('doctest', content.text_content(self.raw))
|
||||
if self.code == 'Okay':
|
||||
|
@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
from flake8 import engine
|
||||
import pep8
|
||||
import pycodestyle
|
||||
|
||||
import hacking.tests
|
||||
|
||||
@ -28,9 +28,9 @@ def check(physical_line):
|
||||
class HackingTestCase(hacking.tests.TestCase):
|
||||
def test_local_check(self):
|
||||
flake8_style = engine.get_style_guide(parse_argv=False, ignore='F')
|
||||
report = pep8.BaseReport(flake8_style.options)
|
||||
report = pycodestyle.BaseReport(flake8_style.options)
|
||||
line = ["#this-is-the-test-phrase"]
|
||||
checker = pep8.Checker(lines=line, options=flake8_style.options,
|
||||
report=report)
|
||||
checker = pycodestyle.Checker(lines=line, options=flake8_style.options,
|
||||
report=report)
|
||||
checker.check_all()
|
||||
self.assertIn("L100", report.counters)
|
||||
|
@ -3,9 +3,5 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
|
||||
pep8==1.5.7 # MIT
|
||||
pyflakes==0.8.1 # MIT
|
||||
flake8<2.6.0,>=2.5.4 # MIT
|
||||
mccabe==0.2.1 # MIT License
|
||||
|
||||
flake8>=2.6.0,<2.7.0 # MIT
|
||||
six>=1.9.0 # MIT
|
||||
|
Loading…
Reference in New Issue
Block a user