mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-20 02:53:44 +08:00
9fb45b315a
# Conflicts: # README.md # docs/CARS.md # opendbc_repo # tinygrad_repo # tools/release/build_release.sh # tools/release/build_stripped.sh
46 lines
1.0 KiB
Python
Executable File
46 lines
1.0 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import os
|
|
import re
|
|
import subprocess
|
|
import sys
|
|
|
|
HERE = os.path.abspath(os.path.dirname(__file__))
|
|
ROOT = os.path.abspath(os.path.join(HERE, "../.."))
|
|
|
|
blacklist = [
|
|
".git/",
|
|
".venv/",
|
|
".github/workflows/",
|
|
|
|
"matlab.*.md",
|
|
|
|
# no LFS or submodules in release
|
|
".lfsconfig",
|
|
".gitattributes",
|
|
".git$",
|
|
".gitmodules",
|
|
".run/",
|
|
".idea/",
|
|
]
|
|
|
|
# gets you through the blacklist
|
|
whitelist: list[str] = [
|
|
]
|
|
|
|
|
|
if __name__ == "__main__":
|
|
tracked_files = subprocess.check_output(["git", "ls-files", "-z", "--recurse-submodules"], cwd=ROOT).split(b"\0")
|
|
for tracked_file in tracked_files:
|
|
if not tracked_file:
|
|
continue
|
|
|
|
rf = os.fsdecode(tracked_file)
|
|
if not os.getenv("INCLUDE_BIG_MODEL") and rf.startswith("openpilot/selfdrive/modeld/models/big_driving_supercombo.onnx"):
|
|
continue
|
|
blacklisted = any(re.search(p, rf) for p in blacklist)
|
|
whitelisted = any(re.search(p, rf) for p in whitelist)
|
|
if blacklisted and not whitelisted:
|
|
continue
|
|
|
|
sys.stdout.buffer.write(tracked_file + b"\0")
|