chore(python): build with flit instead of hatch
What changed, and why it matters
This commit changes the Python packaging tool used to build the trezorlib package from Hatch to Flit. It only touches the project's build configuration file (pyproject.toml) and adjusts which files are included or excluded when the package is published. There is no change to the actual Trezor firmware, device code, or any security-sensitive logic.
No security action needed. Treat as a routine build-system maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates python/pyproject.toml to switch the build backend from hatchling to flit_core and rewrites the include/exclude lists for source distributions. The package metadata, dependencies, and entry points are unchanged. No runtime code is modified.
Changed components
python/pyproject.tomlInspect captured patch +17 / −11
diff --git a/python/pyproject.toml b/python/pyproject.toml
index b74e5afd..8266f8f3 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -60,23 +60,29 @@ Documentation = "https://github.com/trezor/trezor-firmware/tree/main/python"
trezorctl = "trezorlib.cli.trezorctl:cli"
[build-system]
-requires = ["hatchling"]
-build-backend = "hatchling.build"
+requires = ["flit_core >= 3.11,<5"]
+build-backend = "flit_core.buildapi"
[tool.uv]
package = true
-[tool.hatch.build.targets.wheel]
-packages = ["src/trezorlib"]
+[tool.flit.module]
+name = "trezorlib"
-[tool.hatch.build.targets.sdist]
+[tool.flit.sdist]
+include = [
+ "bash_completion.d",
+ "docs",
+ "stubs",
+ "tests",
+ "tools",
+ "AUTHORS",
+ "CHANGELOG.md",
+ "setup.cfg",
+ "pyrightconfig.json",
+ "tox.ini",
+]
exclude = [
- "/.*",
- "/helper-scripts",
- "/CHANGELOG.unreleased",
- "/default.nix",
- "/Makefile",
- "/towncrier.toml",
"tests/*.bin",
"src/trezorlib/_proto_messages.mako",
]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.