File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 55
66
77
8+
89@task
910def test (c : Context ) -> None :
1011 """
@@ -49,6 +50,33 @@ def test(c: Context) -> None:
4950 print (stderr_output )
5051
5152
53+ @task
54+ def check_version (c : Context ) -> None :
55+ """Validate that ``pyproject.toml`` matches the latest git tag.
56+
57+ This task runs the ``scripts/check_version_match.py`` helper using Poetry
58+ and reports whether the version numbers are aligned.
59+
60+ Args:
61+ c: Invoke context used to run shell commands.
62+
63+ Returns:
64+ None
65+ """
66+ if not isinstance (c , Context ):
67+ raise TypeError (f"Expected Invoke Context, got { type (c ).__name__ !r} " )
68+
69+ # Execute the version check script with Poetry.
70+ cmd = "poetry run python scripts/check_version_match.py"
71+ result = c .run (cmd , warn = True , pty = False )
72+
73+ # Report based on the exit code from the script.
74+ if result .ok :
75+ print ("✔️ pyproject version matches the latest git tag." )
76+ else :
77+ print ("❌ Version mismatch detected." )
78+ print (result .stderr )
79+
5280@task
5381def docs (c : Context ) -> None :
5482 """
You can’t perform that action at this time.
0 commit comments