This commit is contained in:
Your Name
2026-08-27 14:54:18 +08:00
parent 2fa8492c56
commit 74ff568ba4
8 changed files with 89 additions and 52 deletions
+27
View File
@@ -1,7 +1,10 @@
from __future__ import annotations
import tomllib
from pathlib import Path
from doctor_workstation import __version__
PROJECT_ROOT = Path(__file__).resolve().parents[1]
@@ -9,6 +12,30 @@ def read(relative_path: str) -> str:
return (PROJECT_ROOT / relative_path).read_text(encoding="utf-8")
def test_application_version_has_one_source() -> None:
pyproject = tomllib.loads(read("pyproject.toml"))
project = pyproject["project"]
assert "version" not in project
assert "version" in project["dynamic"]
assert pyproject["tool"]["hatch"]["version"]["path"] == (
"src/doctor_workstation/__init__.py"
)
assert __version__
version_template = read("packaging/windows/version_info.template.txt")
assert "@VERSION_TUPLE@" in version_template
assert "@VERSION_STRING@" in version_template
assert "0.1.0" not in version_template
spec = read("packaging/doctor_workstation.spec")
windows_package_script = read("scripts/package_windows.ps1")
macos_package_script = read("scripts/package_macos.sh")
assert 'VERSION_SOURCE = SOURCE_ROOT / "doctor_workstation" / "__init__.py"' in spec
assert 'src\\doctor_workstation\\__init__.py' in windows_package_script
assert 'src/doctor_workstation/__init__.py' in macos_package_script
def test_windows_one_click_entrypoints_and_release_pipeline() -> None:
for name in (
"Run_DoctorWorkstation.bat",