mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
fix: restore CI compatibility for release versioning
Lazy-load tomllib so Python 3.10 test collection succeeds, and apply the repo formatter change required by the 3.12 lint job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
8ac100aa7a
commit
ffe3391b2d
2 changed files with 7 additions and 3 deletions
|
|
@ -2532,7 +2532,8 @@ if __name__ == "__main__":
|
|||
"--openai-api-url", help=f"Custom OpenAI API URL (default: {HeadroomProxy.OPENAI_API_URL})"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--anthropic-api-url", help=f"Custom Anthropic API URL (default: {HeadroomProxy.ANTHROPIC_API_URL})"
|
||||
"--anthropic-api-url",
|
||||
help=f"Custom Anthropic API URL (default: {HeadroomProxy.ANTHROPIC_API_URL})",
|
||||
)
|
||||
|
||||
# Backend (anthropic direct, bedrock, openrouter, anyllm, or litellm-<provider>)
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ from collections.abc import Sequence
|
|||
from dataclasses import dataclass, replace
|
||||
from pathlib import Path
|
||||
|
||||
import tomllib
|
||||
|
||||
SEMVER_RE = re.compile(r"^(\d+)\.(\d+)\.(\d+)$")
|
||||
RELEASE_TAG_RE = re.compile(r"^v(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?$")
|
||||
|
||||
|
|
@ -126,6 +124,11 @@ def compute_release_version(
|
|||
def get_canonical_version(root: Path) -> str:
|
||||
"""Read the canonical project version from pyproject.toml."""
|
||||
|
||||
try:
|
||||
import tomllib
|
||||
except ModuleNotFoundError: # pragma: no cover - Python 3.10 compatibility
|
||||
import tomli as tomllib
|
||||
|
||||
with open(root / "pyproject.toml", "rb") as file:
|
||||
data = tomllib.load(file)
|
||||
return data["project"]["version"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue