Skip to content

Commit 2c0d114

Browse files
committed
Update hacking and pyproject.toml
Removed python 3.10 support. Moved to hacking 7.0.0 and updated pyproject.toml to basically match neutron. Changed _validate_allowed_address_pairs() slightly to reduce compexity value. TrivialFix Change-Id: I0dafc59cde7d0cf02e4c126c35cee9c1bcb3cda0 Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
1 parent 4c4d5de commit 2c0d114

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

neutron_lib/api/validators/allowedaddresspairs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ def _validate_allowed_address_pairs(address_pairs, valid_values=None):
5959

6060
mac = address_pair.get('mac_address')
6161
ip_address = address_pair['ip_address']
62-
if (mac, ip_address) not in unique_check:
63-
unique_check[(mac, ip_address)] = None
64-
else:
62+
if (mac, ip_address) in unique_check:
6563
raise exceptions.DuplicateAddressPairInRequest(
6664
mac_address=mac, ip_address=ip_address)
6765

66+
unique_check[(mac, ip_address)] = None
67+
6868
invalid_attrs = set(address_pair.keys()) - {'mac_address',
6969
'ip_address'}
7070
if invalid_attrs:

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,17 @@ authors = [
99
{name = "OpenStack", email = "openstack-discuss@lists.openstack.org"},
1010
]
1111
readme = {file = "README.rst", content-type = "text/x-rst"}
12-
license = {text = "Apache-2.0"}
12+
license = "Apache-2.0"
1313
dynamic = ["version", "dependencies"]
1414
requires-python = ">=3.10"
1515
classifiers = [
1616
"Development Status :: 5 - Production/Stable",
1717
"Environment :: OpenStack",
1818
"Intended Audience :: Information Technology",
1919
"Intended Audience :: System Administrators",
20-
"License :: OSI Approved :: Apache Software License",
2120
"Operating System :: POSIX :: Linux",
2221
"Programming Language :: Python",
2322
"Programming Language :: Python :: 3",
24-
"Programming Language :: Python :: 3.10",
2523
"Programming Language :: Python :: 3.11",
2624
"Programming Language :: Python :: 3.12",
2725
"Programming Language :: Python :: 3.13",
@@ -55,10 +53,8 @@ N536 = "neutron_lib.hacking.checks:assert_equal_none"
5553
N537 = "neutron_lib.hacking.translation_checks:no_translate_logs"
5654
N535 = "neutron_lib.hacking.checks:check_no_eventlet_imports"
5755

58-
[tool.setuptools]
59-
packages = [
60-
"neutron_lib"
61-
]
56+
[tool.setuptools.packages.find]
57+
include = ["neutron_lib*"]
6258

6359
[tool.mypy]
6460
incremental = true
@@ -76,7 +72,8 @@ files = "neutron_lib"
7672
line-length = 79
7773

7874
[tool.ruff.lint]
79-
select = ["E4", "E5", "E7", "E9", "F", "G", "S", "UP"]
75+
select = ["C90", "E", "F", "G", "S", "UP", "W"]
76+
preview = true
8077
ignore = [
8178
"S104", # Possible binding to all interfaces
8279
"S311", # Suspicious non-cryptographic random usage
@@ -85,3 +82,6 @@ ignore = [
8582

8683
[tool.ruff.lint.per-file-ignores]
8784
"neutron_lib/tests/*" = ["S"]
85+
86+
[tool.ruff.lint.mccabe]
87+
max-complexity = 16

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fixtures>=3.0.0 # Apache-2.0/BSD
2-
hacking>=6.1.0,<=8.0.0 # Apache-2.0
2+
hacking>=7.0.0,<=8.0.0 # Apache-2.0
33
oslotest>=3.2.0 # Apache-2.0
44
stestr>=1.0.0 # Apache-2.0
55
testtools>=2.2.0 # MIT

0 commit comments

Comments
 (0)