okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Terminal 0.2.4 / Control and engine 0.1.49: version bump for the DeepSeek V4.1-Flash release (app stays 0.2.3, Mac stays 0.1.48); release notes8ea7fef82

main
3.0 KiB65 linesraw
1"""The Terminal tells people the app's version (0.2.3), and its README no longer contradicts itself."""
2
3from __future__ import annotations
4
5import re
6import subprocess
7import sys
8import unittest
9from pathlib import Path
10
11import strata_cli
12
13ROOT = Path(__file__).resolve().parents[2]
14sys.path.insert(0, str(ROOT / "packaging"))
15import package_terminal  # noqa: E402
16
17
18class ProductVersion(unittest.TestCase):
19    def test_it_is_the_apps_own_version_or_a_terminal_only_release_after_it(self):
20        cargo = ROOT / "apps" / "desktop" / "src-tauri" / "Cargo.toml"
21        if not cargo.is_file():
22            self.skipTest("no app source in this tree")
23        m = re.search(r'^version\s*=\s*"([^"]+)"', cargo.read_text(encoding="utf-8"), re.MULTILINE)
24        # 0.2.3.1 is a Control-only hotfix: the Terminal says 0.2.3.1 while the app (and its updater entry) stay 0.2.3
25        # 0.2.4 is a Terminal release: the app stays 0.2.3 (the Terminal is never older than the app)
26        as_tuple = lambda v: tuple(int(p) for p in v.split("."))
27        self.assertGreaterEqual(as_tuple(strata_cli.PRODUCT_VERSION), as_tuple(m.group(1)))
28        self.assertEqual(as_tuple(strata_cli.PRODUCT_VERSION)[:2], as_tuple(m.group(1))[:2])
29
30    def test_dash_dash_version_leads_with_it_and_keeps_the_build_number(self):
31        out = subprocess.run([sys.executable, str(ROOT / "strata.py"), "--version"], capture_output=True, text=True, check=True).stdout
32        self.assertTrue(out.startswith(f"strata {strata_cli.PRODUCT_VERSION} (build {strata_cli.version()};"), out)
33        self.assertIn(sys.executable, out)                                  # the packaging smoke test reads the interpreter back from this line
34
35    def test_the_build_number_stays_numeric_for_the_engine_compatibility_checks(self):
36        self.assertRegex(strata_cli.version(), r"^[0-9]+(\.[0-9]+)+$")
37
38
39class Readme(unittest.TestCase):
40    def readme(self, target: str) -> str:
41        return package_terminal._readme("0.2.3", target)
42
43    def test_it_does_not_say_nothing_downloads_and_then_that_launch_fetches(self):
44        text = " ".join(self.readme("windows-x86_64").split())
45        self.assertNotIn("Starting and serving never install or download anything", text)
46        self.assertIn("Serving and watching", text)
47        self.assertIn("Only two commands fetch files", text)
48        self.assertIn("`strata launch`", text)
49
50    def test_the_launch_doc_it_points_at_is_in_the_archive(self):
51        self.assertIn("docs/TERMINAL_LAUNCH.md", self.readme("linux-x86_64"))
52        self.assertIn("docs/TERMINAL_LAUNCH.md", package_terminal.PAYLOAD)
53        self.assertTrue((ROOT / "docs" / "TERMINAL_LAUNCH.md").is_file())
54
55    def test_free_memory_guidance_fits_the_system(self):
56        win, lin, mac = (self.readme(t) for t in ("windows-x86_64", "linux-x86_64", "darwin-arm64"))
57        self.assertNotIn("free -g", win)
58        self.assertIn("FreePhysicalMemory", win)
59        self.assertIn("Task Manager", win)
60        self.assertIn("free -g", lin)
61        self.assertNotIn("free -g", mac)
62
63
64if __name__ == "__main__":
65    unittest.main()