mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-08 13:33:42 +08:00
8cb60d82fe
Provide laptop and device build entry points, cache compatibility checks and developer tooling. Keep distribution assets and model packaging available before runtime consumers.
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))
|