From 23efe236f457100a4c5ea4b9782c06378f116487 Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Thu, 15 May 2025 20:25:36 -0700 Subject: [PATCH] moar --- release/pack.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/release/pack.py b/release/pack.py index 8e30da7f90..7d9e972424 100755 --- a/release/pack.py +++ b/release/pack.py @@ -11,13 +11,14 @@ from pathlib import Path from openpilot.common.basedir import BASEDIR -EXTS = ['.png', '.py', '.svg', '.ttf'] +DIRS = ['cereal', 'openpilot'] +EXTS = ['.png', '.py', '.svg', '.ttf', '.capnp'] INTERPRETER = '/usr/bin/env python3' def copy(src, dest, follow_symlinks=False): if any(src.endswith(ext) for ext in EXTS): - shutil.copy2(src, dest, follow_symlinks=follow_symlinks) + shutil.copy2(src, dest, follow_symlinks=True) if __name__ == '__main__': @@ -31,6 +32,7 @@ if __name__ == '__main__': args.output = args.module try: + print(args.module) mod = importlib.import_module(args.module) except ModuleNotFoundError: print(f'{args.module} not found, typo?') @@ -40,8 +42,10 @@ if __name__ == '__main__': print(f'{args.module} does not have a {args.entrypoint}() function, typo?') sys.exit(1) - with tempfile.TemporaryDirectory() as tmp: - shutil.copytree(BASEDIR + '/openpilot', tmp + '/openpilot', symlinks=False, dirs_exist_ok=True, copy_function=copy) + with tempfile.TemporaryDirectory(delete=False) as tmp: + print(tmp) + for directory in DIRS: + shutil.copytree(BASEDIR + '/' + directory, tmp + '/' + directory, symlinks=False, dirs_exist_ok=True, copy_function=copy) entry = f'{args.module}:{args.entrypoint}' zipapp.create_archive(tmp, target=args.output, interpreter=INTERPRETER, main=entry)