Support legacy module version declarations
This commit is contained in:
@@ -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
|
in the previous release baseline. A failed candidate-baseline check therefore
|
||||||
cannot produce a protected package release.
|
cannot produce a protected package release.
|
||||||
|
|
||||||
The source gate validates `pyproject.toml`, module `MODULE_VERSION`, public
|
The source gate validates `pyproject.toml`, the module version declaration
|
||||||
package `__version__`, and WebUI metadata before creating tags. Release-tag
|
(`MODULE_VERSION` or the top-level `ModuleManifest.version`), public package
|
||||||
artifact checks run only after the candidate tags and immutable WebUI lock have
|
`__version__`, and WebUI metadata before creating tags. Release-tag artifact
|
||||||
been created locally.
|
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
|
It builds one wheel and, where applicable, one npm tarball. The workflow records
|
||||||
the source tag, source commit, filename, size, and SHA-256 in
|
the source tag, source commit, filename, size, and SHA-256 in
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ class ReleaseEntrypointGateTests(unittest.TestCase):
|
|||||||
def test_version_updater_targets_canonical_runtime_declarations(self) -> None:
|
def test_version_updater_targets_canonical_runtime_declarations(self) -> None:
|
||||||
script = (META_ROOT / "tools" / "release" / "push-release-tag.sh").read_text()
|
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.assertIn("update_package_init_versions", script)
|
||||||
self.assertNotIn("could not update ModuleManifest.version", script)
|
self.assertNotIn("could not update ModuleManifest.version", script)
|
||||||
|
|
||||||
|
|||||||
@@ -338,8 +338,15 @@ text, count = re.subn(
|
|||||||
text,
|
text,
|
||||||
count=1,
|
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:
|
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)
|
path.write_text(text)
|
||||||
PYCODE
|
PYCODE
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user