Files
sunnypilot/tools/release/release_files.py
T
Jason Wen 9fb45b315a Merge commit '053d9c446800df38aca42b69bb99197aefbea77b' into sync-20260816
# Conflicts:
#	README.md
#	docs/CARS.md
#	opendbc_repo
#	tinygrad_repo
#	tools/release/build_release.sh
#	tools/release/build_stripped.sh
2026-08-17 00:38:50 -04:00

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")