Prepare the 1.0.0 GA release surface
Add the repo-side pieces for milestone 5: MIT licensing, real maintainer and forge metadata, a public support doc, 1.0.0 release notes, release-prep tooling, and CI uploads for the full candidate artifact set. Keep source-tree version surfaces honest by reading the local project version in the CLI and About dialog, and cover the new release-prep plus version-fallback behavior with focused tests. Document where raw validation evidence belongs, add the GA validation rollup, and archive the latest readiness review. Milestone 5 remains open until the forge release page is published and the milestone 2 and 3 matrices are filled with linked manual evidence. Validation: PYTHONPATH=src python3 -m unittest discover -s tests -p 'test_*.py'; PYTHONPATH=src python3 -m unittest tests.test_release_prep tests.test_portable_bundle tests.test_aman_cli tests.test_config_ui; python3 -m py_compile src/*.py tests/*.py; PYTHONPATH=src python3 -m aman version
This commit is contained in:
parent
acfc376845
commit
31a1e069b3
28 changed files with 591 additions and 33 deletions
|
|
@ -242,6 +242,14 @@ class AmanCliTests(unittest.TestCase):
|
|||
self.assertEqual(exit_code, 0)
|
||||
self.assertEqual(out.getvalue().strip(), "1.2.3")
|
||||
|
||||
def test_app_version_prefers_local_pyproject_version(self):
|
||||
pyproject_text = '[project]\nversion = "9.9.9"\n'
|
||||
|
||||
with patch.object(aman.Path, "exists", return_value=True), patch.object(
|
||||
aman.Path, "read_text", return_value=pyproject_text
|
||||
), patch("aman.importlib.metadata.version", return_value="1.0.0"):
|
||||
self.assertEqual(aman._app_version(), "9.9.9")
|
||||
|
||||
def test_doctor_command_json_output_and_exit_code(self):
|
||||
report = DiagnosticReport(
|
||||
checks=[DiagnosticCheck(id="config.load", status="ok", message="ok", next_step="")]
|
||||
|
|
|
|||
|
|
@ -11,9 +11,11 @@ from config import Config
|
|||
from config_ui import (
|
||||
RUNTIME_MODE_EXPERT,
|
||||
RUNTIME_MODE_MANAGED,
|
||||
_app_version,
|
||||
apply_canonical_runtime_defaults,
|
||||
infer_runtime_mode,
|
||||
)
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
class ConfigUiRuntimeModeTests(unittest.TestCase):
|
||||
|
|
@ -38,6 +40,14 @@ class ConfigUiRuntimeModeTests(unittest.TestCase):
|
|||
self.assertFalse(cfg.models.allow_custom_models)
|
||||
self.assertEqual(cfg.models.whisper_model_path, "")
|
||||
|
||||
def test_app_version_prefers_local_pyproject_version(self):
|
||||
pyproject_text = '[project]\nversion = "9.9.9"\n'
|
||||
|
||||
with patch("config_ui.Path.exists", return_value=True), patch(
|
||||
"config_ui.Path.read_text", return_value=pyproject_text
|
||||
), patch("config_ui.importlib.metadata.version", return_value="1.0.0"):
|
||||
self.assertEqual(_app_version(), "9.9.9")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
88
tests/test_release_prep.py
Normal file
88
tests/test_release_prep.py
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def _project_version() -> str:
|
||||
for line in (ROOT / "pyproject.toml").read_text(encoding="utf-8").splitlines():
|
||||
if line.startswith('version = "'):
|
||||
return line.split('"')[1]
|
||||
raise RuntimeError("project version not found")
|
||||
|
||||
|
||||
def _write_file(path: Path, content: str) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(content, encoding="utf-8")
|
||||
|
||||
|
||||
class ReleasePrepScriptTests(unittest.TestCase):
|
||||
def test_prepare_release_writes_sha256sums_for_expected_artifacts(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
tmp_path = Path(tmp)
|
||||
dist_dir = tmp_path / "dist"
|
||||
arch_dir = dist_dir / "arch"
|
||||
version = _project_version()
|
||||
|
||||
_write_file(dist_dir / f"aman-{version}-py3-none-any.whl", "wheel\n")
|
||||
_write_file(dist_dir / f"aman-x11-linux-{version}.tar.gz", "portable\n")
|
||||
_write_file(dist_dir / f"aman-x11-linux-{version}.tar.gz.sha256", "checksum\n")
|
||||
_write_file(dist_dir / f"aman_{version}_amd64.deb", "deb\n")
|
||||
_write_file(arch_dir / "PKGBUILD", "pkgbuild\n")
|
||||
_write_file(arch_dir / f"aman-{version}.tar.gz", "arch-src\n")
|
||||
|
||||
env = os.environ.copy()
|
||||
env["DIST_DIR"] = str(dist_dir)
|
||||
|
||||
subprocess.run(
|
||||
["bash", "./scripts/prepare_release.sh"],
|
||||
cwd=ROOT,
|
||||
env=env,
|
||||
text=True,
|
||||
capture_output=True,
|
||||
check=True,
|
||||
)
|
||||
|
||||
sha256sums = (dist_dir / "SHA256SUMS").read_text(encoding="utf-8")
|
||||
self.assertIn(f"./aman-{version}-py3-none-any.whl", sha256sums)
|
||||
self.assertIn(f"./aman-x11-linux-{version}.tar.gz", sha256sums)
|
||||
self.assertIn(f"./aman-x11-linux-{version}.tar.gz.sha256", sha256sums)
|
||||
self.assertIn(f"./aman_{version}_amd64.deb", sha256sums)
|
||||
self.assertIn(f"./arch/PKGBUILD", sha256sums)
|
||||
self.assertIn(f"./arch/aman-{version}.tar.gz", sha256sums)
|
||||
|
||||
def test_prepare_release_fails_when_expected_artifact_is_missing(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
tmp_path = Path(tmp)
|
||||
dist_dir = tmp_path / "dist"
|
||||
arch_dir = dist_dir / "arch"
|
||||
version = _project_version()
|
||||
|
||||
_write_file(dist_dir / f"aman-{version}-py3-none-any.whl", "wheel\n")
|
||||
_write_file(dist_dir / f"aman-x11-linux-{version}.tar.gz", "portable\n")
|
||||
_write_file(dist_dir / f"aman-x11-linux-{version}.tar.gz.sha256", "checksum\n")
|
||||
_write_file(arch_dir / "PKGBUILD", "pkgbuild\n")
|
||||
_write_file(arch_dir / f"aman-{version}.tar.gz", "arch-src\n")
|
||||
|
||||
env = os.environ.copy()
|
||||
env["DIST_DIR"] = str(dist_dir)
|
||||
|
||||
result = subprocess.run(
|
||||
["bash", "./scripts/prepare_release.sh"],
|
||||
cwd=ROOT,
|
||||
env=env,
|
||||
text=True,
|
||||
capture_output=True,
|
||||
check=False,
|
||||
)
|
||||
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertIn("missing required release artifact", result.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue