Drop flake8 upper version constraint
Clear up lint as a result of new pep8/flake8 version. Change-Id: I3698766cb751b31ef1e6b806baa45c1cf6f7d899
This commit is contained in:
parent
59c5d493bb
commit
f0a486c59d
|
@ -456,7 +456,7 @@ class BaseOpenStackCharm(object, metaclass=BaseOpenStackCharmMeta):
|
|||
"""
|
||||
version_or_codename = get_snap_version(snap, fatal)
|
||||
|
||||
match = re.match('^(\d+)\.(\d+)', version_or_codename)
|
||||
match = re.match(r'^(\d+)\.(\d+)', version_or_codename)
|
||||
if match:
|
||||
version = match.group(0)
|
||||
# Generate a major version number for newer semantic
|
||||
|
@ -527,7 +527,7 @@ class BaseOpenStackCharm(object, metaclass=BaseOpenStackCharmMeta):
|
|||
|
||||
# x.y match only for 20XX.X
|
||||
# and ignore patch level for other packages
|
||||
match = re.match('^(\d+)\.(\d+)', vers)
|
||||
match = re.match(r'^(\d+)\.(\d+)', vers)
|
||||
|
||||
if match:
|
||||
vers = match.group(0)
|
||||
|
@ -910,9 +910,9 @@ class BaseOpenStackCharmActions(object):
|
|||
protocol = protocol.lower()
|
||||
else:
|
||||
protocol = ''
|
||||
lines = [l for l in
|
||||
lines = [line for line in
|
||||
subprocess.check_output(_args).decode('UTF-8').split()
|
||||
if l]
|
||||
if line]
|
||||
ports = []
|
||||
for line in lines:
|
||||
p, p_type = line.split('/')
|
||||
|
|
|
@ -233,7 +233,7 @@ class TestRegisteredHooks(PatchHelper):
|
|||
# check that the lists are equal - this is made out of the
|
||||
# list of dictionaries: args = [{..., 'args': (..)}, {}, ...]
|
||||
# this flatten's the list-of-dicts['args'] to a flat tuple
|
||||
l = tuple(itertools.chain.from_iterable(
|
||||
largs = tuple(itertools.chain.from_iterable(
|
||||
[a['args'] for a in args]))
|
||||
self.assertEqual(sorted(l), sorted(p[f]),
|
||||
self.assertEqual(sorted(largs), sorted(p[f]),
|
||||
"for function '{}'".format(f))
|
||||
|
|
|
@ -2,7 +2,7 @@ simplejson
|
|||
requests
|
||||
httpretty
|
||||
pep8
|
||||
flake8>=2.2.4,<=2.4.1
|
||||
flake8>=2.2.4
|
||||
stestr
|
||||
paramiko<2.0
|
||||
charms.reactive
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = pep8,py27,py37
|
||||
envlist = pep8,py3
|
||||
skipsdist = True
|
||||
skip_missing_interpreters = True
|
||||
|
||||
|
@ -33,6 +33,10 @@ deps = -r{toxinidir}/test-requirements.txt
|
|||
basepython = python3.7
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:py38]
|
||||
basepython = python3.8
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python3
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
|
|
|
@ -83,6 +83,7 @@ def _fake_retry(num_retries, base_delay=0, exc_type=Exception):
|
|||
return _retry_on_exception_inner_2
|
||||
return _retry_on_exception_inner_1
|
||||
|
||||
|
||||
mock.patch(
|
||||
'charmhelpers.core.decorators.retry_on_exception',
|
||||
_fake_retry).start()
|
||||
|
@ -91,6 +92,7 @@ mock.patch(
|
|||
def _fake_cached(f):
|
||||
return f
|
||||
|
||||
|
||||
mock.patch(
|
||||
'charmhelpers.core.hookenv.cached',
|
||||
_fake_cached).start()
|
||||
|
|
|
@ -36,7 +36,7 @@ class TestHelpers(BaseTestCase):
|
|||
with utils.is_data_changed('bar', "string") as f:
|
||||
self.assertTrue(f)
|
||||
raise Exception()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
self.assertEqual(hash, store.get('charms.openstack.data_changed.bar'))
|
||||
# check that raising an exception AND having the flag set causes a
|
||||
|
@ -46,7 +46,7 @@ class TestHelpers(BaseTestCase):
|
|||
no_change_on_exception=False) as f:
|
||||
self.assertTrue(f)
|
||||
raise Exception()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
self.assertNotEqual(hash,
|
||||
store.get('charms.openstack.data_changed.bar'))
|
||||
|
|
Loading…
Reference in New Issue