-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsiglent-gui.spec
More file actions
152 lines (139 loc) · 3.91 KB
/
Copy pathsiglent-gui.spec
File metadata and controls
152 lines (139 loc) · 3.91 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec file for Siglent Oscilloscope GUI application.
This file defines how to build standalone executables for Windows, macOS, and Linux.
"""
import sys
import os
from pathlib import Path
block_cipher = None
# Get version from package or environment
def get_version():
"""Get version from scpi_control package or environment variable."""
# Try environment variable first (set by CI)
version = os.environ.get('APP_VERSION')
if version:
return version.lstrip('v') # Remove 'v' prefix if present
# Try importing from package
try:
import scpi_control
return scpi_control.__version__
except:
return "0.0.0"
APP_VERSION = get_version()
print(f"Building version: {APP_VERSION}")
# Determine platform-specific settings
is_windows = sys.platform.startswith('win')
is_macos = sys.platform == 'darwin'
is_linux = sys.platform.startswith('linux')
# Icon file paths (create these in resources/ directory)
if is_windows:
icon_file = 'resources/Test Equipment.ico'
elif is_macos:
icon_file = 'resources/Test Equipment.icns'
else:
icon_file = None # Linux doesn't use icon in executable
# Check if icon exists, otherwise set to None
if icon_file and not Path(icon_file).exists():
print(f"Warning: Icon file not found: {icon_file}")
icon_file = None
a = Analysis(
['scpi_control/gui/app.py'],
pathex=[],
binaries=[],
datas=[
# Include README and LICENSE in distribution
('README.md', '.'),
('LICENSE', '.'),
# Uncomment if you add resource files (images, etc.)
# ('resources', 'resources'),
],
hiddenimports=[
# Core dependencies
'numpy',
'matplotlib',
'matplotlib.backends.backend_qt5agg',
'scipy',
'scipy.signal',
'scipy.fft',
'scipy.io',
# PyQt6 modules
'PyQt6',
'PyQt6.QtCore',
'PyQt6.QtGui',
'PyQt6.QtWidgets',
'PyQt6.QtWebEngineWidgets',
'PyQt6.QtWebEngineCore',
'PyQt6.sip',
# PyQtGraph
'pyqtgraph',
'pyqtgraph.graphicsItems',
'pyqtgraph.exporters',
# Optional dependencies
'h5py',
'shapely',
'PIL',
'PIL.Image',
'svgpathtools',
# SCPI Control package modules
'scpi_control',
'scpi_control.gui',
'scpi_control.gui.widgets',
'scpi_control.gui.utils',
'scpi_control.protocol_decoders',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Exclude unused modules to reduce size
'tkinter',
'IPython',
'jupyter',
'notebook',
'pytest',
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='SiglentGUI',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True, # Compress with UPX (reduces file size by ~30%)
upx_exclude=[],
runtime_tmpdir=None,
console=False, # No console window for GUI application
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=icon_file,
)
# macOS-specific: Create .app bundle
if is_macos:
app = BUNDLE(
exe,
name='SiglentGUI.app',
icon=icon_file,
bundle_identifier='com.siglent.oscilloscope-gui',
info_plist={
'CFBundleName': 'Siglent Oscilloscope',
'CFBundleDisplayName': 'Siglent Oscilloscope Control',
'CFBundleVersion': APP_VERSION,
'CFBundleShortVersionString': APP_VERSION,
'NSHighResolutionCapable': 'True',
'LSMinimumSystemVersion': '10.13.0',
},
)