From 774793976c2b9b9e98076b349e51c7aed46859e8 Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Tue, 4 Aug 2026 15:08:46 +0200 Subject: [PATCH] Support legacy module version declarations --- docs/PACKAGE_REGISTRY_RELEASES.md | 9 +++++---- tests/test_release_entrypoint_gates.py | 3 ++- tools/release/push-release-tag.sh | 9 ++++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/PACKAGE_REGISTRY_RELEASES.md b/docs/PACKAGE_REGISTRY_RELEASES.md index e9f9aa3..ce3a178 100644 --- a/docs/PACKAGE_REGISTRY_RELEASES.md +++ b/docs/PACKAGE_REGISTRY_RELEASES.md @@ -66,10 +66,11 @@ tags. The default preflight intentionally does not require those heads to exist in the previous release baseline. A failed candidate-baseline check therefore cannot produce a protected package release. -The source gate validates `pyproject.toml`, module `MODULE_VERSION`, public -package `__version__`, and WebUI metadata before creating tags. Release-tag -artifact checks run only after the candidate tags and immutable WebUI lock have -been created locally. +The source gate validates `pyproject.toml`, the module version declaration +(`MODULE_VERSION` or the top-level `ModuleManifest.version`), public package +`__version__`, and WebUI metadata before creating tags. Release-tag artifact +checks run only after the candidate tags and immutable WebUI lock have been +created locally. It builds one wheel and, where applicable, one npm tarball. The workflow records the source tag, source commit, filename, size, and SHA-256 in diff --git a/tests/test_release_entrypoint_gates.py b/tests/test_release_entrypoint_gates.py index 6914d89..4eea92a 100644 --- a/tests/test_release_entrypoint_gates.py +++ b/tests/test_release_entrypoint_gates.py @@ -74,7 +74,8 @@ class ReleaseEntrypointGateTests(unittest.TestCase): def test_version_updater_targets_canonical_runtime_declarations(self) -> None: script = (META_ROOT / "tools" / "release" / "push-release-tag.sh").read_text() - self.assertIn("could not update MODULE_VERSION", script) + self.assertIn("^manifest\\s*=\\s*ModuleManifest", script) + self.assertIn("could not update module version declaration", script) self.assertIn("update_package_init_versions", script) self.assertNotIn("could not update ModuleManifest.version", script) diff --git a/tools/release/push-release-tag.sh b/tools/release/push-release-tag.sh index c30fcab..34ef495 100644 --- a/tools/release/push-release-tag.sh +++ b/tools/release/push-release-tag.sh @@ -338,8 +338,15 @@ text, count = re.subn( text, count=1, ) +if count == 0: + text, count = re.subn( + r'(?ms)(^manifest\s*=\s*ModuleManifest\(.*?^\s*version\s*=\s*)["\'][^"\']+["\'](,?\s*)$', + rf'\1"{new_version}"\2', + text, + count=1, + ) if count != 1: - raise SystemExit(f"could not update MODULE_VERSION in {path}") + raise SystemExit(f"could not update module version declaration in {path}") path.write_text(text) PYCODE done