Files
StarPilot/tools/vendor/check.py
T
firestar5683 22a8575199 Vendor dependencies and resources for standalone builds
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
2026-10-03 21:01:18 +00:00

30 lines
933 B
Python
Executable File

#!/usr/bin/env python3
"""Check tracked dependency folders, locally or at a fetched revision."""
import argparse
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(ROOT))
from openpilot.common.vendor_manifest import validate_revision, validate_worktree
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--revision", help="Validate a committed revision instead of the working tree")
args = parser.parse_args()
try:
manifest = validate_revision(ROOT, args.revision) if args.revision else validate_worktree(ROOT)
except (ValueError, OSError, subprocess.CalledProcessError) as e:
print(f"Source validation failed: {e}", file=sys.stderr)
return 1
print(f"Source layout valid: {len(manifest['dependencies'])} tracked dependency folders")
return 0
if __name__ == "__main__":
sys.exit(main())