@@ -24,17 +24,34 @@ sys.path.insert(0, repo_root)
2424# Collect all submodules for pywebview to ensure platform-specific backends are included
2525pywebview_hiddenimports = collect_submodules ('webview' )
2626
27- # Collect HTML/CSS/JS assets from webview_gui/assets/
28- assets_dir = os .path .join (repo_root , 'whisperjav' , 'webview_gui' , 'assets' )
27+ # Collect data files for bundling
2928datas = []
3029
30+ # 1. Collect HTML/CSS/JS assets from webview_gui/assets/
31+ assets_dir = os .path .join (repo_root , 'whisperjav' , 'webview_gui' , 'assets' )
3132if os .path .exists (assets_dir ):
3233 for filename in os .listdir (assets_dir ):
3334 file_path = os .path .join (assets_dir , filename )
3435 if os .path .isfile (file_path ):
3536 # Bundle as webview_gui_assets/ in the executable
3637 datas .append ((file_path , 'webview_gui_assets' ))
3738
39+ # 2. Collect config files
40+ config_dir = os .path .join (repo_root , 'whisperjav' , 'config' )
41+ if os .path .exists (config_dir ):
42+ for filename in os .listdir (config_dir ):
43+ if filename .endswith ('.json' ):
44+ file_path = os .path .join (config_dir , filename )
45+ datas .append ((file_path , 'whisperjav/config' ))
46+
47+ # 3. Collect translation defaults
48+ translate_defaults = os .path .join (repo_root , 'whisperjav' , 'translate' , 'defaults' )
49+ if os .path .exists (translate_defaults ):
50+ for filename in os .listdir (translate_defaults ):
51+ if filename .endswith ('.txt' ):
52+ file_path = os .path .join (translate_defaults , filename )
53+ datas .append ((file_path , 'whisperjav/translate/defaults' ))
54+
3855# Get icon path
3956icon_path = os .path .join (assets_dir , 'icon.ico' )
4057if not os .path .exists (icon_path ):
@@ -50,6 +67,7 @@ a = Analysis(
5067 binaries = [],
5168 datas = datas ,
5269 hiddenimports = [
70+ # PyWebView dependencies
5371 'webview' ,
5472 'webview.window' ,
5573 'webview.platforms' ,
@@ -59,17 +77,50 @@ a = Analysis(
5977 'whisperjav.webview_gui' ,
6078 'whisperjav.webview_gui.api' ,
6179 'whisperjav.webview_gui.main' ,
80+ # WhisperJAV core modules
81+ 'whisperjav' ,
82+ 'whisperjav.pipelines' ,
83+ 'whisperjav.pipelines.faster_pipeline' ,
84+ 'whisperjav.pipelines.fast_pipeline' ,
85+ 'whisperjav.pipelines.balanced_pipeline' ,
86+ 'whisperjav.modules' ,
87+ 'whisperjav.modules.audio_extraction' ,
88+ 'whisperjav.modules.scene_detection' ,
89+ 'whisperjav.modules.audio_preprocessing' ,
90+ 'whisperjav.modules.stable_ts_asr' ,
91+ 'whisperjav.modules.whisper_pro_asr' ,
92+ 'whisperjav.modules.srt_postprocessing' ,
93+ 'whisperjav.modules.subtitle_sanitizer' ,
94+ 'whisperjav.modules.media_discovery' ,
95+ 'whisperjav.utils' ,
96+ 'whisperjav.utils.logger' ,
97+ 'whisperjav.utils.metadata_manager' ,
98+ 'whisperjav.utils.progress_aggregator' ,
99+ 'whisperjav.config' ,
100+ 'whisperjav.config.manager' ,
101+ # Core scientific packages
102+ 'numpy' ,
103+ 'numpy.core' ,
104+ 'scipy' ,
105+ 'scipy.ndimage' ,
106+ 'scipy.signal' ,
107+ # Whisper dependencies
108+ 'whisper' ,
109+ 'stable_whisper' ,
110+ 'faster_whisper' ,
111+ # Audio processing
112+ 'soundfile' ,
113+ 'librosa' ,
114+ 'auditok' ,
62115 ] + pywebview_hiddenimports ,
63116 hookspath = [],
64117 hooksconfig = {},
65118 runtime_hooks = [],
66119 excludes = [
67- 'tkinter' , # Exclude Tkinter to reduce size
68- 'matplotlib' ,
69- 'scipy' ,
70- 'numpy' ,
71- 'torch' ,
72- 'PIL' ,
120+ # Exclude old Tkinter GUI (replaced by PyWebView)
121+ 'tkinter' ,
122+ 'tkinter.ttk' ,
123+ '_tkinter' ,
73124 # Exclude all Qt bindings - PyWebView uses WebView2 on Windows, not Qt
74125 'PyQt5' ,
75126 'PyQt5.QtCore' ,
@@ -90,6 +141,8 @@ a = Analysis(
90141 'PyQt5.sip' ,
91142 'sip' ,
92143 ],
144+ # NOTE: DO NOT exclude numpy, scipy, torch, matplotlib, or PIL/Pillow
145+ # These are REQUIRED core dependencies for WhisperJAV!
93146 win_no_prefer_redirects = False ,
94147 win_private_assemblies = False ,
95148 cipher = None ,
0 commit comments