Files
Niko1221 a42cc3d7df Version 0.2.7: Terminal and app 0.2.7, engine and Control 0.1.52 (every Qwen and DeepSeek package, Metal included; both engines changed since 0.2.6)
Same 15 files as the 0.2.6 bump (issue template, AGENTS.md, CMakeLists.txt 0.1.52, desktop and host package files, Cargo.toml and the strata-desktop entry in Cargo.lock, SettingsUpdates comment, qa1-storage test, metal 0.1.52-metal, build_hip_linux.sh PKGVER 0.1.52, strata_cli PRODUCT_VERSION, the two version tests), plus the Strata-0.2.7-<file> names in the md files.
2026-10-27 09:13:22 +01:00

30 lines
1.1 KiB
Python

"""Terminal clients for the shared Strata server."""
import re
from pathlib import Path
SCHEMA_VERSION = 1
#: The version people are told: the Strata app's own (apps/desktop/src-tauri/Cargo.toml `version`; tests/terminal/test_tuiqa_version.py keeps the
#: two equal, except for a Terminal-only release such as 0.2.3.1 or 0.2.4, whose app stays 0.2.3). `version()` below is the files' build number, which the engine-compatibility checks compare, so it stays numeric.
PRODUCT_VERSION = "0.2.7"
def version() -> str:
"""The terminal's version: the VERSION file of an archive, else the source tree's CMake project version."""
root = Path(__file__).resolve().parents[1]
try:
text = (root / "VERSION").read_text(encoding="utf-8").strip()
if text:
return text
except OSError:
pass
try:
m = re.search(r"^\s*project\([^)]*?VERSION\s+([0-9]+(?:\.[0-9]+)+)",
(root / "CMakeLists.txt").read_text(encoding="utf-8", errors="replace"), re.MULTILINE)
if m:
return m.group(1)
except OSError:
pass
return "unknown"