From e6ced7fff6b7ce10e92cfe0c2cfdf3dabf3700cf Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Wed, 18 Sep 2024 08:18:27 -0400 Subject: [PATCH 1/2] actions: remove add_lib hack and use contents_directory PyInstaller feature instead --- src/gam.spec | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gam.spec b/src/gam.spec index b94cd2db..a548442f 100644 --- a/src/gam.spec +++ b/src/gam.spec @@ -22,12 +22,6 @@ hiddenimports = [ ] runtime_hooks = [] -if getenv('PYINSTALLER_BUILD_ONEDIR') == 'yes': - # for onedir, add_lib.py allows moving many - # library files into a lib/ directory to make - # onedir cleaner. Thanks to: - # https://medium.com/@philipp.h/reduce-clutter-when-using-pyinstaller-in-one-directory-mode-b631b9f7f89b - runtime_hooks.append('add_lib.py') a = Analysis( ['gam/__main__.py'], pathex=[], @@ -92,6 +86,8 @@ if getenv('PYINSTALLER_BUILD_ONEDIR') == 'yes': strip=strip, upx=upx, console=console, + # put most everyting under a lib/ subfolder + contents_directory='lib', disable_windowed_traceback=disable_windowed_traceback, argv_emulation=argv_emulation, target_arch=target_arch, From 0221781a0525ed57cc65645f74f7904f1c224317 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Wed, 18 Sep 2024 08:19:08 -0400 Subject: [PATCH 2/2] [no ci] remove add_lib.py hack file --- src/add_lib.py | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 src/add_lib.py diff --git a/src/add_lib.py b/src/add_lib.py deleted file mode 100644 index 8e55ed0a..00000000 --- a/src/add_lib.py +++ /dev/null @@ -1,12 +0,0 @@ -import os -import sys - -''' -for onedir, add_lib.py allows moving many -library files into a lib/ directory to make -onedir cleaner. Thanks to: -https://medium.com/@philipp.h/reduce-clutter-when-using-pyinstaller-in -one-directory-mode-b631b9f7f89b -''' - -sys.path.append(os.path.join(os.getcwd(), 'lib')) -sys._MEIPASS=os.path.join(sys._MEIPASS, 'lib')