ci: publish formal version from pyproject.toml on main push
All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 25s

Remove .postN CI versioning, fix runtime version_ge for legacy post releases, and use ASCII issue separators in health output.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-07 09:26:41 +08:00
parent c9398451d0
commit 36a411810d
7 changed files with 91 additions and 109 deletions

View File

@@ -23,7 +23,7 @@ __all__ = [
"LaunchError",
"GatewayDownError",
]
__version__ = "1.0.9"
__version__ = "1.0.11"
def __getattr__(name: str):

View File

@@ -71,9 +71,23 @@ def _resolve_data_root(env: Mapping[str, str]) -> str:
return platform_default_data_root()
def _parse_version(version: str) -> tuple[int, ...]:
def _parse_version(version: str) -> tuple[int, int, int, int]:
"""Parse major.minor.patch[.postN] into (major, minor, patch, post)."""
text = version.strip()
post = 0
if ".post" in text:
base, _, post_part = text.partition(".post")
post_digits = ""
for ch in post_part:
if ch.isdigit():
post_digits += ch
else:
break
post = int(post_digits) if post_digits else 0
text = base
parts: list[int] = []
for piece in version.strip().split("."):
for piece in text.split("."):
digits = ""
for ch in piece:
if ch.isdigit():
@@ -82,11 +96,15 @@ def _parse_version(version: str) -> tuple[int, ...]:
break
if digits:
parts.append(int(digits))
return tuple(parts)
while len(parts) < 3:
parts.append(0)
return parts[0], parts[1], parts[2], post
def version_ge(installed: str, required: str) -> bool:
"""Compare PEP 440-like versions without external deps (post release suffix ignored)."""
"""Compare semver-like versions without external deps (supports legacy .postN)."""
return _parse_version(installed) >= _parse_version(required)
@@ -281,7 +299,7 @@ def format_runtime_health_lines(diagnostics: RuntimeDiagnostics) -> list[str]:
f"record_video_enabled: {diagnostics.record_video_enabled}",
]
for issue in diagnostics.issues:
lines.append(f"runtime_issue[{issue.severity}]: {issue.code} {issue.message}")
lines.append(f"runtime_issue[{issue.severity}]: {issue.code} - {issue.message}")
return lines