@@ -26,9 +26,37 @@ a = Analysis(
2626 # "some_dynamic_imported_module",
2727 ],
2828 hookspath = [],
29- hooksconfig = {},
29+ hooksconfig = {
30+ # Prevent matplotlib hook from selecting GTK/Tk backends on Linux.
31+ "matplotlib" : {"backends" : "QtAgg" },
32+ # If Gtk is pulled in indirectly, do not recurse through /usr/share/icons and themes.
33+ "gi" : {"icons" : [], "themes" : [], "languages" : []},
34+ },
3035 runtime_hooks = [],
31- excludes = [],
36+ # Ensure only PyQt6 is collected. The source contains PyQt5 fallback imports,
37+ # but frozen builds should ship exactly one Qt binding.
38+ excludes = [
39+ "PyQt5" ,
40+ "PyQt5.sip" ,
41+ "PySide2" ,
42+ "PySide6" ,
43+ # Exclude GUI stacks not used by this Qt app.
44+ "IPython" ,
45+ "ipykernel" ,
46+ "gi" ,
47+ "gi.repository" ,
48+ "tkinter" ,
49+ "PIL.ImageTk" ,
50+ # Avoid GTK backend pull-in from matplotlib in frozen Qt app.
51+ "matplotlib.backends.backend_gtk3" ,
52+ "matplotlib.backends.backend_gtk3agg" ,
53+ "matplotlib.backends.backend_gtk3cairo" ,
54+ "matplotlib.backends.backend_gtk4" ,
55+ "matplotlib.backends.backend_gtk4agg" ,
56+ "matplotlib.backends.backend_gtk4cairo" ,
57+ "matplotlib.backends.backend_tkagg" ,
58+ "matplotlib.backends.backend_tkcairo" ,
59+ ],
3260 win_no_prefer_redirects = False ,
3361 win_private_assemblies = False ,
3462 cipher = block_cipher ,
@@ -64,4 +92,4 @@ coll = COLLECT(
6492 upx = True ,
6593 upx_exclude = [],
6694 name = "SerialUI" ,
67- )
95+ )
0 commit comments