Skip to content

Commit 9f842b7

Browse files
committed
build(setup.py): modernize setuptools
And hopefully fix some warnings
1 parent 64d05df commit 9f842b7

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
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]
@@ -123,10 +123,14 @@ download = "https://github.com/ArduPilot/MethodicConfigurator/releases"
123123
changelog = "https://github.com/ArduPilot/MethodicConfigurator/releases"
124124

125125
[tool.setuptools]
126-
packages = ["ardupilot_methodic_configurator"]
126+
# Rely on discovery for just the top-level package and specify data via package-data
127+
include-package-data = false
128+
129+
[tool.setuptools.packages.find]
130+
include = ["ardupilot_methodic_configurator"]
127131

128132
[tool.setuptools.package-data]
129-
ardupilot_methodic_configurator = ["*.param", "*.png", "*.jpg", "*.json", "*.xml", "*.mo", "*.png"]
133+
ardupilot_methodic_configurator = ["**/*.param", "**/*.png", "**/*.jpg", "**/*.json", "**/*.xml", "**/*.mo", "**/*.png"]
130134

131135
[tool.setuptools.dynamic]
132136
version = {attr = "ardupilot_methodic_configurator.__version__"}

setup.py

100755100644
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
"""
42
Creates the ardupilot_methodic_configurator pip python package.
53
@@ -33,6 +31,18 @@ def find_data_files(globs: list[str]) -> list[tuple[str, list[str]]]:
3331

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

0 commit comments

Comments
 (0)