oliver-zehentleitner / maity
clean-up: G6 tools and scripts: build files: lock-check and release-build copied across Makefiles, PY vs PYTHON, cli/setup.py outside lint, hatch_build type: ignore
tsk-tvk5atq3306p Open
From the clean-up audit tsk-hgnbapyw7hnh (uncovered files, G6: CLI leftovers, public-page leftovers, tools and scripts), read at 9dfd4b65.
1. lock-check is written three times and release-build twice (duplication)
- Files:
lock-checkin hub/Makefile:66-74, cli/Makefile:44-60 and tools/Makefile:14-20 (each: copy the inputs to a temp dir, strip--hash=lines with the samesed, recompile with$(LOCK),diff -u).release-buildin hub/Makefile:89-94 and cli/Makefile:67-72 (same five lines; hub makes the venv with$(PYTHON), cli with a hard-codedpython3). - What is wrong: a fix to one copy (for example the hash stripping, or the venv's Python) has to be made three times, and the copies have already drifted.
- Proposal: one
mk/locks.mkat the repository root with alock_checkmacro (inputs, outputs, constraints) and arelease_buildrecipe, included by the three Makefiles. The cli-only setuptools pin check (thepython3 -cstep at the end of cli/Makefile's lock-check) stays in cli/Makefile. - Effort: M. Risk: low to medium; CI's hub-lock, cli and changelog jobs run these targets, so the PR proves itself.
2. The Python variable is PYTHON in hub/ and PY in cli/ (naming)
- Files: hub/Makefile:4
PYTHON ?= python3; cli/Makefile:1PY ?= ...; tools/pre_push.py:37PYTHON_VARIABLE = {"hub": "PYTHON", "cli": "PY"}exists only to bridge the two names; cli/Makefile:25 and :69 callpython3directly instead of the variable. - Proposal:
PYTHONin both (cli keeps its.venvdefault), use it at cli/Makefile:25 and :69, dropPYTHON_VARIABLE. Update CONTRIBUTING.md/README lines that namePY=if any. - Effort: S. Risk: low (a local
make PY=...habit changes).
3. cli/setup.py is not linted or type-checked (debt)
- Files: cli/Makefile:7-17 (
ruff/black/mypyoversrc testsonly); cli/setup.py (30 lines, importsmaity.versioninfoafter asys.path.insert). The hub checks its build hook: hub/Makefile:17-24 and hub/pyproject.toml:71 name hatch_build.py. - Proposal: add setup.py to the cli
lint,formatandtypechecktargets. - Effort: S. Risk: none.
4. hub/hatch_build.py silences mypy instead of giving the type parameter (debt, type: ignore)
- Files: hub/hatch_build.py:34
class BundleHook(BuildHookInterface): # type: ignore[type-arg]. hatchling'sBuildHookInterfaceisGeneric[BuilderConfigBound](hatchling/builders/hooks/plugin/interface.py:12 in the locked version). - Proposal:
BuildHookInterface[BuilderConfig](fromhatchling.builders.config) and drop the ignore. - Effort: S. Risk: none.
Covered elsewhere
None. Searched: hatch_build, release-build, lock-check, PYTHON_VARIABLE.
Effort: M + 3S.
Notes
Lotse · Nov 18, 2026, 20:06 UTC
Item 1 (the lock-check copied across the Makefiles) moves to tsk-kgkh3gz3mkfz, which already holds it. Leave it out here (lotse, req-gqt5b2812nej).