Bump to hacking 2.x
This allows us to use a new version of flake8 that supports Python 3-only syntax. Existing issues are resolved. Change-Id: I5de7e5cde6a5260f4e7e57586952256b59d3756d Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
da7cd17a2b
commit
298c5107eb
@ -40,6 +40,7 @@ class IOTLightbulb(base.VersionedObject):
|
|||||||
'manufactured_on': obj_fields.DateTimeField(),
|
'manufactured_on': obj_fields.DateTimeField(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Now do some basic operations on a light bulb.
|
# Now do some basic operations on a light bulb.
|
||||||
bulb = IOTLightbulb(serial='abc-123', manufactured_on=datetime.now())
|
bulb = IOTLightbulb(serial='abc-123', manufactured_on=datetime.now())
|
||||||
print("The __str__() output of this new object: %s" % bulb)
|
print("The __str__() output of this new object: %s" % bulb)
|
||||||
|
@ -1255,8 +1255,7 @@ class CoercedList(CoercedCollectionMixin, list):
|
|||||||
super(CoercedList, self).append(self._coerce_item(len(self) + 1, x))
|
super(CoercedList, self).append(self._coerce_item(len(self) + 1, x))
|
||||||
|
|
||||||
def extend(self, t):
|
def extend(self, t):
|
||||||
l = len(self)
|
coerced_items = [self._coerce_item(len(self) + index, item)
|
||||||
coerced_items = [self._coerce_item(l + index, item)
|
|
||||||
for index, item in enumerate(t)]
|
for index, item in enumerate(t)]
|
||||||
super(CoercedList, self).extend(coerced_items)
|
super(CoercedList, self).extend(coerced_items)
|
||||||
|
|
||||||
@ -1264,8 +1263,7 @@ class CoercedList(CoercedCollectionMixin, list):
|
|||||||
super(CoercedList, self).insert(i, self._coerce_item(i, x))
|
super(CoercedList, self).insert(i, self._coerce_item(i, x))
|
||||||
|
|
||||||
def __iadd__(self, y):
|
def __iadd__(self, y):
|
||||||
l = len(self)
|
coerced_items = [self._coerce_item(len(self) + index, item)
|
||||||
coerced_items = [self._coerce_item(l + index, item)
|
|
||||||
for index, item in enumerate(y)]
|
for index, item in enumerate(y)]
|
||||||
return super(CoercedList, self).__iadd__(coerced_items)
|
return super(CoercedList, self).__iadd__(coerced_items)
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ def _patch_mock_to_raise_for_invalid_assert_calls():
|
|||||||
mock.Mock.__getattr__ = raise_for_invalid_assert_calls(
|
mock.Mock.__getattr__ = raise_for_invalid_assert_calls(
|
||||||
mock.Mock.__getattr__)
|
mock.Mock.__getattr__)
|
||||||
|
|
||||||
|
|
||||||
# NOTE(gibi): needs to be called only once at import time
|
# NOTE(gibi): needs to be called only once at import time
|
||||||
# to patch the mock lib
|
# to patch the mock lib
|
||||||
_patch_mock_to_raise_for_invalid_assert_calls()
|
_patch_mock_to_raise_for_invalid_assert_calls()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
# The order of packages is significant, because pip processes them in the order
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
hacking>=2.0.0,<2.1.0 # Apache-2.0
|
||||||
oslotest>=3.2.0 # Apache-2.0
|
oslotest>=3.2.0 # Apache-2.0
|
||||||
testtools>=2.2.0 # MIT
|
testtools>=2.2.0 # MIT
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
|
3
tox.ini
3
tox.ini
@ -46,8 +46,9 @@ deps =
|
|||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# E123, E125 skipped as they are invalid PEP-8.
|
# E123, E125 skipped as they are invalid PEP-8.
|
||||||
|
# W504 skipped as you must choose this or W503
|
||||||
show-source = True
|
show-source = True
|
||||||
ignore = E123,E125
|
ignore = E123,E125,W504
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user