-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclimdata_gui.spec
More file actions
201 lines (179 loc) · 7.73 KB
/
Copy pathclimdata_gui.spec
File metadata and controls
201 lines (179 loc) · 7.73 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# -*- mode: python ; coding: utf-8 -*-
# PyInstaller spec for climdata_gui — macOS arm64 .app bundle
#
# Run from the workspace root:
# pyinstaller climdata_gui.spec --noconfirm
#
# All dependencies are bundled; no Python/conda installation required
# on the target machine.
from PyInstaller.utils.hooks import collect_all, collect_submodules, collect_data_files
block_cipher = None
# ── Collect packages that ship non-Python data files ──────────────────────
# collect_all() returns (datas, binaries, hiddenimports) for each package.
hydra_datas, hydra_bins, hydra_hidden = collect_all('hydra')
omegaconf_datas, omegaconf_bins, omegaconf_hidden = collect_all('omegaconf')
mpl_datas, mpl_bins, mpl_hidden = collect_all('matplotlib')
cartopy_datas, cartopy_bins, cartopy_hidden = collect_all('cartopy')
pyproj_datas, pyproj_bins, pyproj_hidden = collect_all('pyproj')
xclim_datas, xclim_bins, xclim_hidden = collect_all('xclim')
climdata_datas, climdata_bins, climdata_hidden = collect_all('climdata')
# ── Dataset-specific packages (namespace / plugin / data-file heavy) ───────
# google-api-python-client + google-auth are namespace packages; PyInstaller's
# static tracer cannot follow them without explicit collect_all.
google_datas, google_bins, google_hidden = collect_all('googleapiclient')
# google.auth / google.oauth2 live in the same namespace; collect via submodules
googleauth_datas, googleauth_bins, googleauth_hidden = [], [], collect_submodules('google.auth')
googleoauth_datas, googleoauth_bins, googleoauth_hidden = [], [], collect_submodules('google.oauth2')
intake_datas, intake_bins, intake_hidden = collect_all('intake')
intakeesm_datas, intakeesm_bins, intakeesm_hidden = collect_all('intake_esm')
wetterdienst_datas, wetterdienst_bins, wetterdienst_hidden = collect_all('wetterdienst')
cdsapi_datas, cdsapi_bins, cdsapi_hidden = collect_all('cdsapi')
rasterio_datas, rasterio_bins, rasterio_hidden = collect_all('rasterio')
cfxarray_datas, cfxarray_bins, cfxarray_hidden = collect_all('cf_xarray')
yamale_datas, yamale_bins, yamale_hidden = collect_all('yamale')
a = Analysis(
# Entry point — climdata_gui/main.py
['climdata_gui/main.py'],
# Add climdata_gui/ to sys.path so top-level imports like
# "from app import create_app" and "from gui.main_window import …" work.
# Mirrors what _ensure_on_path() does at runtime.
pathex=['climdata_gui'],
binaries=(
hydra_bins + omegaconf_bins + mpl_bins +
cartopy_bins + pyproj_bins + xclim_bins + climdata_bins +
google_bins + googleauth_bins + googleoauth_bins +
intake_bins + intakeesm_bins +
wetterdienst_bins + cdsapi_bins +
rasterio_bins + cfxarray_bins +
yamale_bins
),
datas=[
# GUI resources (Leaflet HTML/JS/CSS, marker PNGs)
# Destination matches paths.resource_path("resources/html/…") in _MEIPASS
('climdata_gui/resources', 'resources'),
# Hydra config (dataset list, variable mappings, regions)
('climdata_gui/conf', 'conf'),
# QSS theme loaded by app.py via resource_path("gui/styles/theme.qss")
('climdata_gui/gui/styles', 'gui/styles'),
] + collect_data_files('certifi') # CA bundle — see utils/certs.py
+ hydra_datas + omegaconf_datas + mpl_datas
+ cartopy_datas + pyproj_datas + xclim_datas + climdata_datas
+ google_datas + googleauth_datas + googleoauth_datas
+ intake_datas + intakeesm_datas
+ wetterdienst_datas + cdsapi_datas
+ rasterio_datas + cfxarray_datas
+ yamale_datas,
hiddenimports=[
# ── PySide6 / QtWebEngine ──────────────────────────────────────────
# These are loaded dynamically by map_widget.py; not detected by
# PyInstaller's static import scanner.
'PySide6.QtWebEngineWidgets',
'PySide6.QtWebEngineCore',
'PySide6.QtWebEngineQuick',
'PySide6.QtWebChannel',
'PySide6.QtNetwork',
'PySide6.QtPositioning',
'PySide6.QtPrintSupport',
# ── GUI top-level modules (resolved via pathex=['climdata_gui']) ───
'app',
'gui',
'gui.main_window',
'gui.map_widget',
'gui.controls',
'gui.controls.dataset_selector',
'gui.controls.date_range_picker',
'gui.controls.yaml_editor',
'backend',
'backend.config_builder',
'backend.runner',
'backend.worker',
'models',
'models.app_state',
'utils',
'utils.paths',
# ── Scientific stack — lazy/plugin-loaded submodules ──────────────
*collect_submodules('geopandas'),
*collect_submodules('rioxarray'),
*collect_submodules('xarray'),
*collect_submodules('dask'),
*collect_submodules('dask.dataframe'),
*collect_submodules('fiona'),
*collect_submodules('shapely'),
*collect_submodules('pandas'),
*collect_submodules('numpy'),
*collect_submodules('scipy'),
*collect_submodules('zarr'),
*collect_submodules('wetterdienst'),
*collect_submodules('pint'),
*collect_submodules('cdsapi'),
*collect_submodules('aiohttp'),
*collect_submodules('rasterio'),
*collect_submodules('cf_xarray'),
*collect_submodules('intake'),
*collect_submodules('intake_esm'),
*collect_submodules('seaborn'),
*collect_submodules('sklearn'),
*collect_submodules('statsmodels'),
*collect_submodules('xsdba'), # BASD tab: QDM / DQM / QM
'certifi', # TLS trust store (utils/certs.py)
*collect_submodules('pyarrow'),
] + hydra_hidden + omegaconf_hidden + mpl_hidden
+ cartopy_hidden + pyproj_hidden + xclim_hidden + climdata_hidden
+ google_hidden + googleauth_hidden + googleoauth_hidden
+ intake_hidden + intakeesm_hidden
+ wetterdienst_hidden + cdsapi_hidden
+ rasterio_hidden + cfxarray_hidden
+ yamale_hidden,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
# Strip unused GUI toolkits to reduce bundle size
excludes=['tkinter', 'PyQt5', 'PyQt6', 'wx', '_tkinter'],
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,
[],
exclude_binaries=True,
name='climdata_gui',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False, # UPX is unreliable with macOS arm64 binaries
console=False, # Suppress terminal window (windowed app)
disable_windowed_traceback=False,
target_arch='arm64',
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name='climdata_gui',
)
app = BUNDLE(
coll,
name='climdata_gui.app',
icon=None, # No .icns available — macOS uses a generic icon
bundle_identifier='de.zalf.climdata',
info_plist={
'CFBundleDisplayName': 'climdata GUI',
'CFBundleShortVersionString': '0.6.0',
'NSHighResolutionCapable': True,
'NSRequiresAquaSystemAppearance': False, # Supports dark mode
# Suppress "App downloaded from internet" quarantine warnings in dev
'LSEnvironment': {
'QTWEBENGINE_DISABLE_SANDBOX': '1',
},
},
)