package_terminal.py builds the terminal archive for windows-x86_64 (.zip), linux-x86_64 and darwin-arm64 (.tar.gz) from the pinned python-build-standalone CPython 3.12.15 (SHA-256 per target, from the release's SHA256SUMS) and a per-target lock, packaging/locks/runtime-<target>-cp312.txt, installed with pip --require-hashes --no-deps --only-binary=:all: at BUILD time only (pip is the interpreter's own, no upgrade; the result must equal the lock). packaging/lock_wheels.py makes a lock. Console-script launchers that name the build path are removed; a VERSION file and the read-only gguf_reader tool join the payload. - bin/strata.cmd and bin/strata.ps1 (Windows), bin/strata (POSIX): the bundled runtime first, PYTHONNOUSERSITE=1, no PYTHONHOME/PYTHONPATH; a path with spaces works. - START-HERE.bat, SETUP.bat, UPDATE.bat, setup.sh, update.sh use a python/ folder beside them when present (no Python lookup or install). - strata --version (one line: version and interpreter), strata serve --engine mock, a typed exit-5 message when the server's packages are missing (strata.py preflight). - packaging/smoke_terminal.py extracts an archive in a clean env (space in the path, PATH without Python, dead proxy) and runs --version, doctor, profile list, install, serve --engine mock (health, models, a chat answer). - tests/terminal/test_packaging_pins.py: digests, lock shape and agreement with requirements.txt, launcher order.
26 lines
738 B
Python
26 lines
738 B
Python
"""Terminal clients for the shared Strata server."""
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
SCHEMA_VERSION = 1
|
|
|
|
|
|
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"
|