← Back to team overview

cloud-init-dev team mailing list archive

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

 

Chad Smith has proposed merging ~chad.smith/cloud-init:cleanup/sync-pycodestyle into cloud-init:master.

Commit message:
pycodestyle: fix deprecated string literals. Pin flakes tox deps.

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

Also bump and pin the tox dependencies for flakes and pycodeflakes in
tox.ini so every CI run validates against most recent tested flakes
version.

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/344976

See commit message
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:cleanup/sync-pycodestyle into cloud-init:master.
diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py
index 1be76fe..9ff929c 100644
--- a/cloudinit/netinfo.py
+++ b/cloudinit/netinfo.py
@@ -138,7 +138,7 @@ def _netdev_info_ifconfig(ifconfig_data):
             elif toks[i].startswith("scope:"):
                 devs[curdev]['ipv6'][-1]['scope6'] = toks[i].lstrip("scope:")
             elif toks[i] == "scopeid":
-                res = re.match(".*<(\S+)>", toks[i + 1])
+                res = re.match(r'.*<(\S+)>', toks[i + 1])
                 if res:
                     devs[curdev]['ipv6'][-1]['scope6'] = res.group(1)
     return devs
diff --git a/tests/unittests/test_handler/test_handler_ntp.py b/tests/unittests/test_handler/test_handler_ntp.py
index 17c5355..6da4564 100644
--- a/tests/unittests/test_handler/test_handler_ntp.py
+++ b/tests/unittests/test_handler/test_handler_ntp.py
@@ -706,7 +706,7 @@ class TestSupplementalSchemaValidation(CiTestCase):
         cfg = {'confpath': 'someconf', 'check_exe': '', 'service_name': '',
                'template': 'asdf', 'template_name': None, 'packages': 'NOPE'}
         match = (r'Invalid ntp configuration:\\nExpected a list of required'
-                 ' package names for ntp:config:packages. Found \(NOPE\)')
+                 ' package names for ntp:config:packages. Found \\(NOPE\\)')
         with self.assertRaisesRegex(ValueError, match):
             cc_ntp.supplemental_schema_validation(cfg)
 
diff --git a/tox.ini b/tox.ini
index 818ade3..268d230 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,9 +10,9 @@ setenv =
 [testenv:flake8]
 basepython = python3
 deps =
-    pycodestyle==2.3.1
-    pyflakes==1.5.0
-    flake8==3.3.0
+    pycodestyle==2.4.0
+    pyflakes==1.6.0
+    flake8==2.5.4
     hacking==0.13.0
 commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/}
 

References