Skip to content

Commit 72be0a1

Browse files
committed
Package builder update
1 parent 9eada81 commit 72be0a1

2 files changed

Lines changed: 37 additions & 6 deletions

File tree

SerialUI.spec

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
)

helpers/Circular_Buffer.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,11 @@ def __init__(self, *_, **__):
547547
if __name__ == "__main__":
548548
import time
549549
import math
550-
import matplotlib.pyplot as plt
551-
from matplotlib.ticker import ScalarFormatter
550+
import importlib
551+
552+
# Keep matplotlib imports dynamic so packagers do not pull it into the app.
553+
plt = importlib.import_module("matplotlib.pyplot")
554+
ScalarFormatter = importlib.import_module("matplotlib.ticker").ScalarFormatter
552555

553556
def benchmark_push(buffer, data_list):
554557
"""Push Benchmark"""
@@ -783,4 +786,4 @@ def collect_and_print():
783786
# Run textual benchmarks
784787
collect_and_print()
785788
# Then collect and plot heatmaps/contours
786-
collect_and_plot()
789+
collect_and_plot()

0 commit comments

Comments
 (0)