-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBPM_Analyzer.spec
More file actions
136 lines (125 loc) · 3.59 KB
/
BPM_Analyzer.spec
File metadata and controls
136 lines (125 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# -*- mode: python ; coding: utf-8 -*-
import os
import importlib.util
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
# Collect Plotly data files including validators
plotly_datas = collect_data_files("plotly")
# Kaleido is used by Plotly to export static images (e.g., PNG).
kaleido_datas = collect_data_files("kaleido")
# Collect ttkbootstrap themes and other package data so the themed UI renders correctly
ttk_datas = collect_data_files("ttkbootstrap")
# Bundle local JS assets needed at runtime (e.g., interactive Plotly controls)
extra_datas = [
(os.path.join("assets", "interactive_plot.js"), os.path.join("assets")),
(os.path.join("assets", "html_inline_minimal.js"), os.path.join("assets")),
(os.path.join("assets", "template.html"), os.path.join("assets")),
]
def _optional_hiddenimports(mod_names):
"""Return only modules that are importable in the build env."""
out = []
for name in mod_names:
if importlib.util.find_spec(name) is not None:
out.append(name)
return out
# SciPy uses internal array_api_compat shims (e.g. scipy._lib.array_api_compat.numpy.fft)
# that PyInstaller can miss, leading to runtime ModuleNotFoundError.
scipy_array_api_hiddenimports = collect_submodules("scipy._lib.array_api_compat")
a = Analysis(
["main.py"],
pathex=[os.path.abspath(".")],
binaries=[],
datas=plotly_datas + kaleido_datas + ttk_datas + extra_datas,
hiddenimports=[
# Core third‑party libs used across the project
"ttkbootstrap",
"pandas",
"scipy",
"numpy",
"plotly",
"plotly.validators",
"plotly.graph_objects",
"plotly.express",
"kaleido",
"kaleido.scopes",
"kaleido.scopes.plotly",
"pydub",
"librosa",
"matplotlib",
"matplotlib.pyplot",
# Project modules that may be imported indirectly
"gui",
"config",
"classifier",
"confidence_engine",
"hrv",
"correction",
"pipeline",
"audio_preprocessing",
"plotting",
"reporting",
"validation",
"peak_utils",
"time_utils",
# Modules used by the pipeline that sometimes get missed by static analysis
"fft_profiles",
"viterbi",
"emissions",
"ui_settings_loader",
"console_logging",
]
+ _optional_hiddenimports(
[
# Optional / dynamic imports
"PIL",
"PIL._tkinter_finder",
"pyPCG",
"pyPCG.preprocessing",
"pywt",
]
)
+ scipy_array_api_hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Prevent PyInstaller from pulling in large ML stacks that are present
# in the environment but not used by this project (can cause recursion/stack overflows).
"tensorflow",
"tensorflow-plugins",
"keras",
"torch",
"torchvision",
"torchaudio",
"transformers",
"jax",
"jaxlib",
"openvino",
"pyside6",
"PySide6",
"pyqt5",
"PyQt5",
],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name="BPM_Analyzer",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)