Enable pep8 checks
Update tox.ini to run flake8 for the pep8 environment, and fix the python source files in the repository that need to be updated to pass the tests. Change-Id: Ib3a1d252de9a7f78705f200a1bdfe51c6b91af19
This commit is contained in:
parent
c3ea9bb9f2
commit
14b8759076
@ -76,7 +76,8 @@ for milestone in seriesmilestones:
|
|||||||
release_is_in_series = True
|
release_is_in_series = True
|
||||||
else:
|
else:
|
||||||
if (args.project == "swift" and
|
if (args.project == "swift" and
|
||||||
not milestone.name.startswith(release.name+"-rc")):
|
not milestone.name.startswith(
|
||||||
|
release.name + "-rc")):
|
||||||
continue
|
continue
|
||||||
milestones.insert(0, milestone)
|
milestones.insert(0, milestone)
|
||||||
print "Found",
|
print "Found",
|
||||||
@ -141,7 +142,8 @@ for milestone in milestones:
|
|||||||
print
|
print
|
||||||
if failed:
|
if failed:
|
||||||
print
|
print
|
||||||
print "Some bugs could not be automatically updated due to LP timeouts:"
|
print("Some bugs could not be automatically updated "
|
||||||
|
"due to LP timeouts:")
|
||||||
for bugid in failed:
|
for bugid in failed:
|
||||||
print "http://bugs.launchpad.net/bugs/%d" % bugid
|
print "http://bugs.launchpad.net/bugs/%d" % bugid
|
||||||
print
|
print
|
||||||
|
@ -91,8 +91,10 @@ def apply_rules(new_version, existing_versions):
|
|||||||
actual = same_minor[2] + 1
|
actual = same_minor[2] + 1
|
||||||
expected = new_version[2]
|
expected = new_version[2]
|
||||||
if expected != actual:
|
if expected != actual:
|
||||||
return ['new version %r increments patch version more than one over %r' %
|
return [
|
||||||
(format_version(new_version), format_version(same_minor))]
|
'new version %r increments patch version more than one over %r'
|
||||||
|
% (format_version(new_version), format_version(same_minor))
|
||||||
|
]
|
||||||
if same_major is not None and same_major != same_minor:
|
if same_major is not None and same_major != same_minor:
|
||||||
print('last version in major series %r' %
|
print('last version in major series %r' %
|
||||||
format_version(same_major))
|
format_version(same_major))
|
||||||
@ -100,11 +102,16 @@ def apply_rules(new_version, existing_versions):
|
|||||||
actual = same_major[1] + 1
|
actual = same_major[1] + 1
|
||||||
expected = new_version[1]
|
expected = new_version[1]
|
||||||
if actual > expected:
|
if actual > expected:
|
||||||
return ['new version %r increments minor version more than one over %r' %
|
return [
|
||||||
(format_version(new_version), format_version(same_major))]
|
('new version %r increments minor '
|
||||||
|
'version more than one over %r') %
|
||||||
|
(format_version(new_version), format_version(same_major))
|
||||||
|
]
|
||||||
if new_version[2] != 0:
|
if new_version[2] != 0:
|
||||||
return ['new version %r increments minor version and patch version' %
|
return [
|
||||||
format_version(new_version)]
|
'new version %r increments minor version and patch version'
|
||||||
|
% format_version(new_version)
|
||||||
|
]
|
||||||
latest_version = existing_versions[-1]
|
latest_version = existing_versions[-1]
|
||||||
if new_version[0] > latest_version[0]:
|
if new_version[0] > latest_version[0]:
|
||||||
return ['%r is a major version increment over %r' %
|
return ['%r is a major version increment over %r' %
|
||||||
|
@ -61,11 +61,13 @@ class RulesTest(base.BaseTestCase):
|
|||||||
('existing series, extra patch number',
|
('existing series, extra patch number',
|
||||||
{'new_version': [1, 1, 3],
|
{'new_version': [1, 1, 3],
|
||||||
'existing_versions': [[0, 1, 0], [1, 0, 0], [1, 1, 1]],
|
'existing_versions': [[0, 1, 0], [1, 0, 0], [1, 1, 1]],
|
||||||
'expected': ["new version '1.1.3' increments patch version more than one over '1.1.1'"]}),
|
'expected': [("new version '1.1.3' increments patch version "
|
||||||
|
"more than one over '1.1.1'")]}),
|
||||||
('existing series, extra patch number in existing minor release',
|
('existing series, extra patch number in existing minor release',
|
||||||
{'new_version': [1, 1, 3],
|
{'new_version': [1, 1, 3],
|
||||||
'existing_versions': [[0, 1, 0], [1, 0, 0], [1, 1, 1], [1, 2, 0]],
|
'existing_versions': [[0, 1, 0], [1, 0, 0], [1, 1, 1], [1, 2, 0]],
|
||||||
'expected': ["new version '1.1.3' increments patch version more than one over '1.1.1'"]}),
|
'expected': [("new version '1.1.3' increments patch "
|
||||||
|
"version more than one over '1.1.1'")]}),
|
||||||
|
|
||||||
('next major number',
|
('next major number',
|
||||||
{'new_version': [2, 0, 0],
|
{'new_version': [2, 0, 0],
|
||||||
@ -85,8 +87,7 @@ class RulesTest(base.BaseTestCase):
|
|||||||
[2013, '1b4'],
|
[2013, '1b4'],
|
||||||
[2013, '1b5'],
|
[2013, '1b5'],
|
||||||
['grizzly-eol'],
|
['grizzly-eol'],
|
||||||
['havana-eol'],
|
['havana-eol']],
|
||||||
],
|
|
||||||
'expected': []}),
|
'expected': []}),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
4
tox.ini
4
tox.ini
@ -15,8 +15,8 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
#deps = flake8
|
deps = flake8
|
||||||
#commands = flake8
|
commands = flake8
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
#commands = {posargs}
|
#commands = {posargs}
|
||||||
|
Loading…
Reference in New Issue
Block a user