Skip to content

Commit 71a9cf1

Browse files
committed
build(setup.py): modernize setuptools
And hopefully fix some warnings
1 parent 2da53a9 commit 71a9cf1

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=61.0", "wheel"]
2+
requires = ["setuptools==80.9.0", "wheel==0.45.1"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -121,10 +121,14 @@ download = "https://github.com/ArduPilot/MethodicConfigurator/releases"
121121
changelog = "https://github.com/ArduPilot/MethodicConfigurator/releases"
122122

123123
[tool.setuptools]
124-
packages = ["ardupilot_methodic_configurator"]
124+
# Rely on discovery for just the top-level package and specify data via package-data
125+
include-package-data = false
126+
127+
[tool.setuptools.packages.find]
128+
include = ["ardupilot_methodic_configurator"]
125129

126130
[tool.setuptools.package-data]
127-
ardupilot_methodic_configurator = ["*.param", "*.jpg", "*.json", "*.xml", "*.mo", "*.png"]
131+
ardupilot_methodic_configurator = ["**/*.param", "**/*.jpg", "**/*.json", "**/*.xml", "**/*.mo", "**/*.png"]
128132

129133
[tool.setuptools.dynamic]
130134
version = {attr = "ardupilot_methodic_configurator.__version__"}

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ def find_data_files(globs: list[str]) -> list[tuple[str, list[str]]]:
3333

3434
setup(
3535
packages=["ardupilot_methodic_configurator"],
36-
# this is used by bdist
36+
include_package_data=False,
37+
package_data={
38+
"ardupilot_methodic_configurator": [
39+
"**/*.param",
40+
"**/*.jpg",
41+
"**/*.json",
42+
"**/*.xml",
43+
"**/*.mo",
44+
"**/*.png",
45+
]
46+
},
47+
# Keep this only for legacy bdist workflows; modern wheels use package_data above
3748
data_files=[*find_data_files(["*.param", "*.jpg", "*.json", "*.xml", "*.mo"])],
3849
)

0 commit comments

Comments
 (0)