diff --git a/scripts/_version.py b/scripts/_version.py index 3fc79d8..6a60822 100644 --- a/scripts/_version.py +++ b/scripts/_version.py @@ -10,4 +10,4 @@ tests/test_action_version.py fails if the two consumers ever disagree again. """ -ACTION_VERSION = "v1.0.3" +ACTION_VERSION = "v1.0.4" diff --git a/scripts/write_firstrun_report.py b/scripts/write_firstrun_report.py index 0f73f9a..144df76 100644 --- a/scripts/write_firstrun_report.py +++ b/scripts/write_firstrun_report.py @@ -12,7 +12,10 @@ import sys from pathlib import Path -ACTION_VERSION = "v1.0.0-rc1" +try: + from _version import ACTION_VERSION +except ImportError: # invoked as a module rather than a script + from scripts._version import ACTION_VERSION def _find_file(root: Path, name: str) -> Path | None: diff --git a/tests/test_action_version.py b/tests/test_action_version.py index 917048c..325f644 100644 --- a/tests/test_action_version.py +++ b/tests/test_action_version.py @@ -41,6 +41,7 @@ def test_both_report_writers_agree() -> None: assert load("compare_runs").ACTION_VERSION == expected assert load("detect_test_set_drift").ACTION_VERSION == expected + assert load("write_firstrun_report").ACTION_VERSION == expected def test_version_matches_the_newest_release_tag() -> None: @@ -70,6 +71,6 @@ def test_version_matches_the_newest_release_tag() -> None: def test_the_stamp_actually_reaches_a_gate_report() -> None: """A constant nothing writes out would pass every check above and still be useless.""" - source = (ROOT / "scripts" / "compare_runs.py").read_text(encoding="utf-8") - - assert '"action_version": ACTION_VERSION' in source + for name in ("compare_runs", "write_firstrun_report"): + source = (ROOT / "scripts" / f"{name}.py").read_text(encoding="utf-8") + assert '"action_version": ACTION_VERSION' in source, name