Bump hacking

hacking 3.0.x is too old.

Change-Id: Ic6d33295b33cff8a68fbb8181973480bc17e7711
This commit is contained in:
Takashi Kajinami 2024-01-27 23:39:42 +09:00
parent 3b4e09f8cd
commit 291ad9c778
8 changed files with 11 additions and 22 deletions

View File

@ -32,7 +32,7 @@ repos:
- id: flake8
name: flake8
additional_dependencies:
- hacking>=3.0.1,<3.1.0
- hacking>=6.1.0,<6.2.0
language: python
entry: flake8
files: '^.*\.py$'

View File

@ -95,7 +95,7 @@ class CastellanConfigurationSourceDriver(sources.ConfigurationSourceDriver):
class CastellanConfigurationSource(sources.ConfigurationSource):
"""A configuration source for configuration values served through castellan.
"""A configuration source for configuration values served through castellan. # noqa
:param config_file: The path to a castellan configuration file.

View File

@ -40,7 +40,7 @@ class ManagedObject(object, metaclass=abc.ABCMeta):
self._name = name
# If None or POSIX times
if not created or type(created) == int:
if not created or isinstance(created, int):
self._created = created
else:
raise ValueError('created must be of long type, actual type %s' %

View File

@ -194,7 +194,7 @@ class KeyManagerTestCase(object):
# created if older objects were not cleaned up, so we will simply
# check if the object we created is in the list
retrieved_objects = self.key_mgr.list(self.ctxt)
self.assertTrue(managed_object in retrieved_objects)
self.assertIn(managed_object, retrieved_objects)
for retrieved_object in retrieved_objects:
self.assertFalse(retrieved_object.is_metadata_only())
self.assertIsNotNone(retrieved_object.id)
@ -217,7 +217,7 @@ class KeyManagerTestCase(object):
# created if older objects were not cleaned up, so we will simply
# check if the object we created is in the list
retrieved_objects = self.key_mgr.list(self.ctxt, metadata_only=True)
self.assertTrue(expected_obj in retrieved_objects)
self.assertIn(expected_obj, retrieved_objects)
for retrieved_object in retrieved_objects:
self.assertTrue(retrieved_object.is_metadata_only())
self.assertIsNotNone(retrieved_object.id)
@ -242,4 +242,4 @@ class KeyManagerTestCase(object):
for retrieved_object in retrieved_objects:
self.assertEqual(type(object_1), type(retrieved_object))
self.assertIsNotNone(retrieved_object.id)
self.assertTrue(object_1 in retrieved_objects)
self.assertIn(object_1, retrieved_objects)

View File

@ -256,6 +256,6 @@ class MockKeyManager(key_manager.KeyManager):
objects = []
for obj_id in self.keys:
obj = self.get(context, obj_id, metadata_only=metadata_only)
if type(obj) == object_type or object_type is None:
if object_type is None or isinstance(obj, object_type):
objects.append(obj)
return objects

View File

@ -229,8 +229,8 @@ class MockKeyManagerTestCase(test_key_mgr.KeyManagerTestCase):
keys = self.key_mgr.list(self.context)
self.assertEqual(2, len(keys))
self.assertTrue(key1 in keys)
self.assertTrue(key2 in keys)
self.assertIn(key1, keys)
self.assertIn(key2, keys)
for key in keys:
self.assertIsNotNone(key.id)
@ -246,7 +246,7 @@ class MockKeyManagerTestCase(test_key_mgr.KeyManagerTestCase):
bit_length_list = [key1.bit_length, key2.bit_length]
for key in keys:
self.assertTrue(key.is_metadata_only())
self.assertTrue(key.bit_length in bit_length_list)
self.assertIn(key.bit_length, bit_length_list)
for key in keys:
self.assertIsNotNone(key.id)

View File

@ -1,7 +1,3 @@
# 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
# process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
cryptography>=2.7 # BSD/Apache-2.0
python-barbicanclient>=5.5.0 # Apache-2.0

View File

@ -1,11 +1,4 @@
# 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
# process, which may cause wedges in the gate later.
hacking>=3.0.1,<3.1.0 # Apache-2.0
# remove this pyflakes from here once you bump the
# hacking to 3.2.0 or above. hacking 3.2.0 takes
# care of pyflakes version compatibilty.
pyflakes>=2.1.1
hacking>=6.1.0,<6.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
python-barbicanclient>=4.5.2 # Apache-2.0