19 lines
603 B
Python
19 lines
603 B
Python
"""Installation paths; no device connections."""
|
|
import os
|
|
from pathlib import Path
|
|
import sys
|
|
ROOT = Path(__file__).resolve().parent
|
|
HUG_RUNTIME = ROOT / "runtime/hug"
|
|
ARM_RUNTIME = ROOT / "runtime/arm"
|
|
PYTHON = os.environ.get("CUP_PYTHON", sys.executable)
|
|
VENV = Path(PYTHON).absolute().parent.parent
|
|
def external(name):
|
|
value = os.environ.get(name)
|
|
if not value:
|
|
raise RuntimeError(f"Optional fresh-object mode requires {name}")
|
|
return Path(value).expanduser().resolve()
|
|
|
|
def resolve_reference(value):
|
|
path = Path(value)
|
|
return path if path.is_absolute() else ROOT / path
|