Skip to content

Commit 8b8717f

Browse files
committed
fix(build): use collect_submodules for auto-including all packages
Instead of manually listing 35+ modules, use PyInstaller's collect_submodules() to automatically include ALL submodules: - excel_to_sql: auto_pilot, sdk, entities, validators, etc. - wareflow_analysis: cli, init, data_import, analyze, export, etc. Benefits: - Simpler: 2 lines instead of 35+ - More robust: Automatically includes new modules - Future-proof: No need to update when packages change - Fixes: All ImportError issues from missing submodules This is the CORRECT approach - include everything automatically instead of manually listing modules. Fixes: 'excel-to-sql>=0.3.0 is required' and all similar errors
1 parent 66b07c4 commit 8b8717f

1 file changed

Lines changed: 11 additions & 28 deletions

File tree

build/gui.spec

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ SPEC_DIR = os.path.join(REPO_ROOT, 'build')
2020
# Collect all data files from excel_to_sql
2121
excel_to_sql_datas = collect_data_files('excel_to_sql')
2222

23+
# Collect ALL submodules from excel_to_sql automatically
24+
excel_to_sql_modules = collect_submodules('excel_to_sql')
25+
26+
# Collect ALL submodules from wareflow_analysis automatically
27+
wareflow_modules = collect_submodules('wareflow_analysis')
28+
2329
a = Analysis(
2430
[os.path.join(REPO_ROOT, 'src', 'wareflow_analysis', 'gui', '__main__.py')],
2531
pathex=[REPO_ROOT],
@@ -72,34 +78,11 @@ a = Analysis(
7278
# Theme detection
7379
'darkdetect',
7480

75-
# Excel-to-SQL
76-
'excel_to_sql',
77-
'excel_to_sql.auto_pilot', # Used by autopilot.py for PatternDetector
78-
79-
# Wareflow Analysis modules (for CLI integration via CliRunner)
80-
'wareflow_analysis',
81-
'wareflow_analysis.cli',
82-
'wareflow_analysis.init',
83-
'wareflow_analysis.data_import',
84-
'wareflow_analysis.data_import.autopilot',
85-
'wareflow_analysis.data_import.importer',
86-
'wareflow_analysis.data_import.header_detector',
87-
'wareflow_analysis.validation',
88-
'wareflow_analysis.validation.validator',
89-
'wareflow_analysis.validation.reporters',
90-
'wareflow_analysis.analyze',
91-
'wareflow_analysis.analyze.abc',
92-
'wareflow_analysis.analyze.inventory',
93-
'wareflow_analysis.export',
94-
'wareflow_analysis.export.reports',
95-
'wareflow_analysis.export.reports.abc_report',
96-
'wareflow_analysis.export.reports.inventory_report',
97-
'wareflow_analysis.export.excel_builder',
98-
'wareflow_analysis.export.excel_formatters',
99-
'wareflow_analysis.database',
100-
'wareflow_analysis.database.manager',
101-
'wareflow_analysis.common',
102-
'wareflow_analysis.common.output_handler',
81+
# Auto-include ALL excel_to_sql submodules (simple & robust)
82+
*excel_to_sql_modules,
83+
84+
# Auto-include ALL wareflow_analysis submodules (for CLI integration)
85+
*wareflow_modules,
10386
],
10487
hookspath=[],
10588
hooksconfig={},

0 commit comments

Comments
 (0)