File tree Expand file tree Collapse file tree 2 files changed +53
-1
lines changed
Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 1919.env
2020
2121# PyInstaller (if you package it as an executable, as mentioned earlier)
22- * .spec
2322dist /
2423build /
2524
Original file line number Diff line number Diff line change 1+ import os
2+ import inspect
3+ import pkgutil
4+ import importlib
5+
6+ # Dynamically collect all submodules in 'commands'
7+ # Use the directory of this spec file to locate 'commands/'
8+ spec_dir = os .path .dirname (os .path .abspath (inspect .getfile (lambda : None )))
9+ commands_dir = os .path .join (spec_dir , "commands" )
10+
11+ # Dynamically collect all submodules in 'commands'
12+ hiddenimports = []
13+ for _ , module_name , _ in pkgutil .iter_modules ([commands_dir ]):
14+ hiddenimports .append (f"commands.{ module_name } " )
15+
16+ # Debugging: Print the collected modules to verify
17+ print ("Hidden imports from 'commands':" , hiddenimports )
18+
19+ a = Analysis (
20+ ['pagertree.py' ],
21+ pathex = [spec_dir ], # Add spec_dir to pathex to ensure module resolution
22+ binaries = [],
23+ datas = [],
24+ hiddenimports = hiddenimports ,
25+ hookspath = [],
26+ hooksconfig = {},
27+ runtime_hooks = [],
28+ excludes = [],
29+ noarchive = False ,
30+ optimize = 0 ,
31+ )
32+ pyz = PYZ (a .pure )
33+
34+ exe = EXE (
35+ pyz ,
36+ a .scripts ,
37+ a .binaries ,
38+ a .datas ,
39+ [],
40+ name = 'pagertree' ,
41+ debug = False ,
42+ bootloader_ignore_signals = False ,
43+ strip = False ,
44+ upx = True ,
45+ upx_exclude = [],
46+ runtime_tmpdir = None ,
47+ console = True ,
48+ disable_windowed_traceback = False ,
49+ argv_emulation = False ,
50+ target_arch = None ,
51+ codesign_identity = None ,
52+ entitlements_file = None ,
53+ )
You can’t perform that action at this time.
0 commit comments