info-tech-canon/src/info_tech_canon/paths.py
tegwick b081d39da1
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 3s
Implement canon conformance and maintenance optimizations
Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a06e82-3e08-7042-a79d-438ac6eed8db
2026-09-05 00:50:09 +02:00

15 lines
482 B
Python

"""Corpus location is independent of the installed Python package."""
import os
from pathlib import Path
def infospace_root(root: Path | str | None = None) -> Path:
if root:
return Path(root).resolve()
if os.environ.get("INFO_TECH_CANON_ROOT"):
return Path(os.environ["INFO_TECH_CANON_ROOT"]).resolve()
local = Path.cwd() / "infospace"
if local.is_dir():
return local.resolve()
return Path(__file__).resolve().parents[2] / "infospace"