mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-06 12:33:51 +08:00
694b460f80
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>
13 lines
573 B
Python
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))
|