Atlas - paths.py
Home / npkg-testing / tools / npkg Lines: 1 | Size: 938 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1from pathlib import Path 2from typing import List 3 4from .types import Package 5 6 7def workspace_root() -> Path: 8 return Path(__file__).resolve().parents[2] 9 10 11def npkg_build_root() -> Path: 12 return workspace_root() / "npkg-build" 13 14 15def out_root() -> Path: 16 return npkg_build_root() 17 18 19def package_stage_dir(pkg: Package) -> Path: 20 return out_root() / "work" / pkg.name / "stage" 21 22 23def package_archive_path(pkg: Package) -> Path: 24 return out_root() / "packages" / f"{pkg.name}-{pkg.version}.tar.gz" 25 26 27def manifest_root(install_root: Path) -> Path: 28 return install_root / ".npkg-db" 29 30 31def package_manifest_path(pkg_name: str, install_root: Path) -> Path: 32 return manifest_root(install_root) / f"{pkg_name}.json" 33 34 35def list_manifest_paths(install_root: Path) -> List[Path]: 36 db_dir = manifest_root(install_root) 37 if not db_dir.exists() or not db_dir.is_dir(): 38 return [] 39 return sorted(db_dir.glob("*.json")) 40[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.