Merge ~chad.smith/cloud-init:cleanup/sync-pycodestyle into cloud-init:master

Proposed by Chad Smith
Status: Merged
Approved by: Chad Smith
Approved revision: 315f0c6ed189e9c704bad25a61fdd9d4f03a86a2
Merge reported by: Chad Smith
Merged at revision: 80dfb3b023a268d6d6204220665c2cf43eac66df
Proposed branch: ~chad.smith/cloud-init:cleanup/sync-pycodestyle
Merge into: cloud-init:master
Diff against target: 67 lines (+11/-9)
3 files modified
cloudinit/netinfo.py (+1/-1)
tests/unittests/test_handler/test_handler_ntp.py (+1/-1)
tox.ini (+9/-7)
Reviewer Review Type Date Requested Status
Chad Smith Abstain
Scott Moser Approve
Server Team CI bot continuous-integration Approve
Joshua Powers (community) Approve
Review via email: mp+344976@code.launchpad.net

Commit message

pycodestyle: Fix deprecated string literals, move away from flake8.

Fix remaining pycodesytle warnings related to invalid string literals
introduced in more recent pycodeflakes versions
https://bugs.python.org/issue27364 .

Also stop using flake8 in tox as it is incompatible with newer versions of
pyflakes. Instead we now add tox environments for pycodestyle and pyflakes
individually.

Set the versions in both pycodestyle and pyflakes to the currently
available versions.

Description of the change

See commit message
to test:
tox -r -e tip-pycodestyle
tox -r -e flake8

To post a comment you must log in.
Revision history for this message
Chad Smith (chad.smith) wrote :
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:e4be9074bad042d974a1bab05719238b9d325635
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1098/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1098/rebuild

review: Approve (continuous-integration)
Revision history for this message
Joshua Powers (powersj) :
f47b728... by Chad Smith

drop flake8 tox env in favor of pycodestyle

c10de3c... by Chad Smith

switch default tox to run pycodestyle

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:c10de3c914e260d62da35fcd57a293fe0beb5762
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1099/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1099/rebuild

review: Approve (continuous-integration)
Revision history for this message
Joshua Powers (powersj) :
review: Approve
315f0c6... by Chad Smith

add pinned pyflakes env and include it in tox default envlist

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:315f0c6ed189e9c704bad25a61fdd9d4f03a86a2
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1100/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1100/rebuild

review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

suggested commit message:

  pycodestyle: Fix deprecated string literals, move away from flake8.

  Fix remaining pycodesytle warnings related to invalid string
  literals introduced in more recent pycodeflakes versions
    https://bugs.python.org/issue27364 .

  Also stop using flake8 in tox as it is incompatible with newer
  versions of pyflakes. Instead we now add tox environments
  for pycodestyle and pyflakes individually.

  Set the versions in both pycodestyle and pyflakes to the currently
  available versions.

Revision history for this message
Scott Moser (smoser) :
review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :

Thank you for your merge proposal.

Your branch has been set to 'Work in progress'.
Please set the branch back to 'Needs Review' after resolving the issues below.

Thanks again,
Your friendly neighborhood cloud-init robot.

Please fix the following issues:
------------------------------
Commit message lints:
 - Line #10 has 2 too many characters. Line starts with: "Set the versions in both"...
------------------------------

For more information, see commit message guidelines at
https://cloudinit.readthedocs.io/en/latest/topics/hacking.html#do-these-things-for-each-feature-or-bug

review: Needs Fixing
Revision history for this message
Chad Smith (chad.smith) :
review: Abstain
Revision history for this message
Chad Smith (chad.smith) wrote :

An upstream commit landed for this bug.

To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=80dfb3b0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py
2index 1be76fe..9ff929c 100644
3--- a/cloudinit/netinfo.py
4+++ b/cloudinit/netinfo.py
5@@ -138,7 +138,7 @@ def _netdev_info_ifconfig(ifconfig_data):
6 elif toks[i].startswith("scope:"):
7 devs[curdev]['ipv6'][-1]['scope6'] = toks[i].lstrip("scope:")
8 elif toks[i] == "scopeid":
9- res = re.match(".*<(\S+)>", toks[i + 1])
10+ res = re.match(r'.*<(\S+)>', toks[i + 1])
11 if res:
12 devs[curdev]['ipv6'][-1]['scope6'] = res.group(1)
13 return devs
14diff --git a/tests/unittests/test_handler/test_handler_ntp.py b/tests/unittests/test_handler/test_handler_ntp.py
15index 17c5355..6da4564 100644
16--- a/tests/unittests/test_handler/test_handler_ntp.py
17+++ b/tests/unittests/test_handler/test_handler_ntp.py
18@@ -706,7 +706,7 @@ class TestSupplementalSchemaValidation(CiTestCase):
19 cfg = {'confpath': 'someconf', 'check_exe': '', 'service_name': '',
20 'template': 'asdf', 'template_name': None, 'packages': 'NOPE'}
21 match = (r'Invalid ntp configuration:\\nExpected a list of required'
22- ' package names for ntp:config:packages. Found \(NOPE\)')
23+ ' package names for ntp:config:packages. Found \\(NOPE\\)')
24 with self.assertRaisesRegex(ValueError, match):
25 cc_ntp.supplemental_schema_validation(cfg)
26
27diff --git a/tox.ini b/tox.ini
28index 818ade3..2fb3209 100644
29--- a/tox.ini
30+++ b/tox.ini
31@@ -1,5 +1,5 @@
32 [tox]
33-envlist = py27, py3, flake8, xenial, pylint
34+envlist = py27, py3, xenial, pycodestyle, pyflakes, pylint
35 recreate = True
36
37 [testenv]
38@@ -7,14 +7,11 @@ commands = python -m nose {posargs:tests/unittests cloudinit}
39 setenv =
40 LC_ALL = en_US.utf-8
41
42-[testenv:flake8]
43+[testenv:pycodestyle]
44 basepython = python3
45 deps =
46- pycodestyle==2.3.1
47- pyflakes==1.5.0
48- flake8==3.3.0
49- hacking==0.13.0
50-commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/}
51+ pycodestyle==2.4.0
52+commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/}
53
54 # https://github.com/gabrielfalcao/HTTPretty/issues/223
55 setenv =
56@@ -118,6 +115,11 @@ deps =
57 commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/}
58 deps = pycodestyle
59
60+[testenv:pyflakes]
61+commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/}
62+deps =
63+ pyflakes==1.6.0
64+
65 [testenv:tip-pyflakes]
66 commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/}
67 deps = pyflakes

Subscribers

People subscribed via source and target branches