Files
StarPilot/tools/laptop_device_build/runtime_paths.py
T
firestar5683 694b460f80 Developer Tools
Provide laptop and device build entry points, cache compatibility checks and developer tooling. Keep distribution assets and model packaging available before runtime consumers.

Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com>

Co-authored-by: prabhaavp <prabhaav@msu.edu>
2026-10-14 20:02:39 -05:00

13 lines
573 B
Python

"""Map virtual-environment library paths to their deployment location."""
from pathlib import PurePosixPath
def runtime_library_path(library_dir: str, build_venv: str, target_venv: str | None = None) -> str:
if target_venv is None:
return library_dir
library, build, target = map(PurePosixPath, (library_dir, build_venv, target_venv))
if not all(path.is_absolute() and ".." not in path.parts for path in (library, build, target)):
raise ValueError("Library and virtual-environment paths must be absolute")
return str(target / library.relative_to(build))