Migrate package metadata from setup.cfg to pyproject.toml

Modernize the packaging configuration by moving all metadata, entry
points, and tool configurations from setup.cfg to pyproject.toml
following PEP 621 standards. This includes project metadata,
classifiers, entry points for extensions and hardware managers,
console scripts, and tool configurations.

A minimal setup.cfg is retained with only the package name for PBR
compatibility, as PBR still requires this file to exist.

Also modifies an inspector test which used a precise count of calls
to the time module... which is a known problematic pattern. The code
has been updated to be more forgiving across python versions and
logging configurations such as the difference which can exist between
unit tests and coverage test checking where this test was found to
be failing in CI. Since this was originally proposed, it looks like
another change removed the check entirely, but I've added it back
with a slightly more graceful model of asserting that there were
calls, just not counting the exact number of calls, asserting
at least a minimum number because changes for python ?3.13? also
previously had to adjust the count.

Assisted-By: Claude Code - Claude Sonnet 4.5
Change-Id: I85209e6cc9a01d6b61527a755e654a9f1844a8e4
Signed-off-by: Julia Kreger <juliaashleykreger@gmail.com>
This commit is contained in:
Julia Kreger
2026-04-09 11:25:10 -07:00
parent f6eb47ecf5
commit 9a30a8a8c8
3 changed files with 87 additions and 75 deletions
@@ -680,6 +680,11 @@ class TestWaitForDhcp(base.IronicAgentTest):
self.assertFalse(inspector.wait_for_dhcp())
mocked_dispatch.assert_called_with('list_network_interfaces')
mocked_sleep.assert_called_once_with(inspector._DHCP_RETRY_INTERVAL)
# time.time() was called 3 times explicitly in wait_for_dhcp(),
# Python 3.13+ uses time.time_ns for logging which varies by logging
# level and coverage configuration, so we cannot assert exact counts
total_time_calls = mocked_time.call_count + mocked_time_ns.call_count
self.assertGreaterEqual(total_time_calls, 3)
def test_disabled(self, mocked_dispatch):
CONF.set_override('inspection_dhcp_wait_timeout', 0)
+79
View File
@@ -2,6 +2,80 @@
requires = ["pbr>=6.0.0", "setuptools>=64.0.0"]
build-backend = "pbr.build"
[project]
name = "ironic-python-agent"
description = "Ironic Python Agent Ramdisk"
authors = [
{name = "OpenStack", email = "openstack-discuss@lists.openstack.org"},
]
license = {text = "Apache-2.0"}
readme = {file = "README.rst", content-type = "text/x-rst"}
requires-python = ">=3.10"
classifiers = [
"Environment :: OpenStack",
"Intended Audience :: System Administrators",
"Intended Audience :: Information Technology",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = ["version", "dependencies"]
[project.urls]
Homepage = "https://docs.openstack.org/ironic-python-agent/"
[project.optional-dependencies]
burnin-network-kazoo = [
"kazoo>=2.8.0",
]
[project.entry-points."oslo.config.opts"]
ironic-python-agent = "ironic_python_agent.config:list_opts"
ironic-python-agent-mdns = "ironic_python_agent.mdns:list_opts"
[project.entry-points."ironic_python_agent.extensions"]
standby = "ironic_python_agent.extensions.standby:StandbyExtension"
clean = "ironic_python_agent.extensions.clean:CleanExtension"
deploy = "ironic_python_agent.extensions.deploy:DeployExtension"
flow = "ironic_python_agent.extensions.flow:FlowExtension"
image = "ironic_python_agent.extensions.image:ImageExtension"
log = "ironic_python_agent.extensions.log:LogExtension"
rescue = "ironic_python_agent.extensions.rescue:RescueExtension"
poll = "ironic_python_agent.extensions.poll:PollExtension"
service = "ironic_python_agent.extensions.service:ServiceExtension"
system = "ironic_python_agent.extensions.system:SystemExtension"
[project.entry-points."ironic_python_agent.hardware_managers"]
generic = "ironic_python_agent.hardware:GenericHardwareManager"
mlnx = "ironic_python_agent.hardware_managers.mlnx:MellanoxDeviceHardwareManager"
cna = "ironic_python_agent.hardware_managers.cna:IntelCnaHardwareManager"
container = "ironic_python_agent.hardware_managers.container:ContainerHardwareManager"
[project.entry-points."ironic_python_agent.inspector.collectors"]
default = "ironic_python_agent.inspector:collect_default"
logs = "ironic_python_agent.inspector:collect_logs"
extra-hardware = "ironic_python_agent.inspector:collect_extra_hardware"
pci-devices = "ironic_python_agent.inspector:collect_pci_devices_info"
numa-topology = "ironic_python_agent.numa_inspector:collect_numa_topology_info"
dmi-decode = "ironic_python_agent.dmi_inspector:collect_dmidecode_info"
lldp = "ironic_python_agent.inspector:collect_lldp"
usb-devices = "ironic_python_agent.inspector:collect_usb_devices"
[project.scripts]
ironic-python-agent = "ironic_python_agent.cmd.agent:run"
ironic-collect-introspection-data = "ironic_python_agent.cmd.inspect:run"
[tool.pbr]
autodoc_index_modules = true
[tool.setuptools]
packages = ["ironic_python_agent"]
[tool.ruff]
line-length = 79
@@ -12,3 +86,8 @@ select = [
"G", # flake8-logging-format
"LOG", # flake8-logging
]
[tool.codespell]
quiet-level = 4
ignore-words-list = "cna,assertin,burnin"
skip = "./releasenotes/build,./venv,./doc/build"
+3 -75
View File
@@ -1,77 +1,5 @@
# All package metadata has been migrated to pyproject.toml
# This file is kept minimal for PBR compatibility
[metadata]
name = ironic-python-agent
description_file =
README.rst
author = OpenStack
author_email = openstack-discuss@lists.openstack.org
home_page = https://docs.openstack.org/ironic-python-agent/
summary = Ironic Python Agent Ramdisk
license = Apache-2
python_requires = >=3.10
classifier =
Environment :: OpenStack
Intended Audience :: System Administrators
Intended Audience :: Information Technology
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
[files]
packages =
ironic_python_agent
[entry_points]
oslo.config.opts =
ironic-python-agent = ironic_python_agent.config:list_opts
ironic-python-agent-mdns = ironic_python_agent.mdns:list_opts
console_scripts =
ironic-python-agent = ironic_python_agent.cmd.agent:run
ironic-collect-introspection-data = ironic_python_agent.cmd.inspect:run
ironic_python_agent.extensions =
standby = ironic_python_agent.extensions.standby:StandbyExtension
clean = ironic_python_agent.extensions.clean:CleanExtension
deploy = ironic_python_agent.extensions.deploy:DeployExtension
flow = ironic_python_agent.extensions.flow:FlowExtension
image = ironic_python_agent.extensions.image:ImageExtension
log = ironic_python_agent.extensions.log:LogExtension
rescue = ironic_python_agent.extensions.rescue:RescueExtension
poll = ironic_python_agent.extensions.poll:PollExtension
service = ironic_python_agent.extensions.service:ServiceExtension
system = ironic_python_agent.extensions.system:SystemExtension
ironic_python_agent.hardware_managers =
generic = ironic_python_agent.hardware:GenericHardwareManager
mlnx = ironic_python_agent.hardware_managers.mlnx:MellanoxDeviceHardwareManager
cna = ironic_python_agent.hardware_managers.cna:IntelCnaHardwareManager
container = ironic_python_agent.hardware_managers.container:ContainerHardwareManager
ironic_python_agent.inspector.collectors =
default = ironic_python_agent.inspector:collect_default
logs = ironic_python_agent.inspector:collect_logs
extra-hardware = ironic_python_agent.inspector:collect_extra_hardware
pci-devices = ironic_python_agent.inspector:collect_pci_devices_info
numa-topology = ironic_python_agent.numa_inspector:collect_numa_topology_info
dmi-decode = ironic_python_agent.dmi_inspector:collect_dmidecode_info
lldp = ironic_python_agent.inspector:collect_lldp
usb-devices = ironic_python_agent.inspector:collect_usb_devices
[extras]
burnin-network-kazoo =
kazoo>=2.8.0 # Apache-2.0
[codespell]
quiet-level = 4
# Words to ignore:
# cna: Intel CNA card
# assertin: valid method in testing
# burnin: name of our burn in methods
ignore-words-list = cna,assertin,burnin
skip = ./releasenotes/build,./venv,./doc/build