Bump hacking

hacking 3.0.x is too old.

This also pulls the hacking options from neutron.

Change-Id: Ic1a428a05131f98d5a9050b83613c5478904f202
This commit is contained in:
Takashi Kajinami 2024-01-28 16:26:45 +09:00
parent 8ae44f83f5
commit 2d93d2e1ed
10 changed files with 31 additions and 25 deletions

View File

@ -138,7 +138,7 @@ def str2dict(strdict, required_keys=None, optional_keys=None):
msg = _("missing value for key '%s'")
raise argparse.ArgumentTypeError(msg % kv)
else:
kvlist[i-1] = "%s,%s" % (kvlist[i-1], kv)
kvlist[i - 1] = "%s,%s" % (kvlist[i - 1], kv)
for kv in kvlist:
key, sep, value = kv.partition('=')
if not sep:

View File

@ -189,7 +189,7 @@ class RemovePeerFromSpeaker(neutronv20.NeutronCommand):
neutron_client.remove_peer_from_bgp_speaker(_speaker_id,
{'bgp_peer_id': _peer_id})
print(_('Removed BGP peer %(peer)s from BGP speaker %(speaker)s.') %
{'peer': parsed_args.bgp_peer,
{'peer': parsed_args.bgp_peer,
'speaker': parsed_args.bgp_speaker},
file=self.app.stdout)

View File

@ -34,7 +34,7 @@ _attr_map = (
('port_pair_group_parameters', 'Port Pair Group Parameters',
column_util.LIST_BOTH),
('description', 'Description', column_util.LIST_LONG_ONLY),
('project_id', 'Project', column_util.LIST_LONG_ONLY),
('project_id', 'Project', column_util.LIST_LONG_ONLY),
('is_tap_enabled', 'Tap Enabled', column_util.LIST_BOTH)
)

View File

@ -213,8 +213,8 @@ def _validate_destination_chains(comma_split, attrs, client, sc_):
dc_ = client.find_sfc_port_chain(e, ignore_missing=False)['id']
attrs['port_chains'][sc_].append(dc_)
if _check_cycle(attrs['port_chains'], sc_, dc_):
raise(exceptions.CommandError(
"Error: Service graph contains a cycle"))
raise exceptions.CommandError(
"Error: Service graph contains a cycle")
else:
raise exceptions.CommandError(
"Error: you must specify at least one "

View File

@ -137,7 +137,7 @@ class TestCreateSfcFlowClassifier(fakes.TestNeutronClientOSCV2):
'logical_destination_port':
self._fc['logical_destination_port'],
'l7_parameters': param
}
}
)
self.assertEqual(self.columns, columns)

View File

@ -47,7 +47,7 @@ class TestCreateSfcPortChain(fakes.TestNeutronClientOSCV2):
self._port_chain['name'],
self._port_chain['port_pair_groups'],
self._port_chain['project_id'],
)
)
def setUp(self):
super(TestCreateSfcPortChain, self).setUp()
@ -357,7 +357,7 @@ class TestSetSfcPortChain(fakes.TestNeutronClientOSCV2):
arglist = [
target,
'--no-port-pair-group',
]
]
verifylist = [
(self.res, target),
('no_port_pair_group', True),

View File

@ -123,8 +123,8 @@ class TestCreateSfcServiceGraph(fakes.TestNeutronClientOSCV2):
arglist = [
"--description", self._service_graph['description'],
"--branching-point", bp1_str,
"--branching-point", bp2_str,
"--branching-point", bp1_str,
"--branching-point", bp2_str,
self._service_graph['name']]
pcs = {'pc1': ['pc2', 'pc3'], 'pc2': ['pc4']}
@ -154,8 +154,8 @@ class TestCreateSfcServiceGraph(fakes.TestNeutronClientOSCV2):
arglist = [
"--description", self._service_graph['description'],
"--branching-point", bp1_str,
"--branching-point", bp2_str,
"--branching-point", bp1_str,
"--branching-point", bp2_str,
self._service_graph['name']]
verifylist = [
@ -175,7 +175,7 @@ class TestCreateSfcServiceGraph(fakes.TestNeutronClientOSCV2):
arglist = [
"--description", self._service_graph['description'],
"--branching-point", bp1_str,
"--branching-point", bp1_str,
self._service_graph['name']]
verifylist = [
@ -196,8 +196,8 @@ class TestCreateSfcServiceGraph(fakes.TestNeutronClientOSCV2):
arglist = [
"--description", self._service_graph['description'],
"--branching-point", bp1_str,
"--branching-point", bp2_str,
"--branching-point", bp1_str,
"--branching-point", bp2_str,
self._service_graph['name']]
verifylist = [

View File

@ -1,10 +1,6 @@
# Requirements lower bounds listed here are our best effort to keep them up to
# date but we do not test them so no guarantee of having them all correct. If
# you find any incorrect lower bounds, let us know or propose a fix.
# 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
cliff>=3.4.0 # Apache-2.0
debtcollector>=1.2.0 # Apache-2.0

View File

@ -1,12 +1,9 @@
# 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
hacking>=6.1.0,<6.2.0 # Apache-2.0
bandit!=1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
flake8-import-order==0.12 # LGPLv3
flake8-import-order>=0.18.0,<0.19.0 # LGPLv3
oslotest>=3.2.0 # Apache-2.0
osprofiler>=2.3.0 # Apache-2.0
python-openstackclient>=3.12.0 # Apache-2.0

15
tox.ini
View File

@ -66,12 +66,25 @@ deps =
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
# H405 multi line docstring summary not separated with an empty line
# I202 Additional newline in a group of imports
# N530 direct neutron imports not allowed
# TODO(amotoki) check the following new rules should be fixed or ignored
# E731 do not assign a lambda expression, use a def
# W504 line break after binary operator
ignore = E126,E128,E731,I202,H405,N530,W504
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools
import-order-style = pep8
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality
# H205: Use assert(Greater|Less)(Equal) for comparison
# H904: Delay string interpolations at logging calls
enable-extensions=H904
enable-extensions=H106,H203,H204,H205,H904
[testenv:bandit]
# B303: blacklist calls: md5, sha1