-
Notifications
You must be signed in to change notification settings - Fork 2
/
wrfplot.spec
81 lines (69 loc) · 2.27 KB
/
wrfplot.spec
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
# -*- mode: python ; coding: utf-8 -*-
import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)
import os
import importlib
block_cipher = None
def include_files(src_dir, dest_dir, startswith=None, endswith=None):
""" Copy files from source to Pyinstaller packed destination """
path_list = []
if os.path.isdir(src_dir):
for file in os.listdir(src_dir):
if startswith is not None:
if file.startswith(startswith):
path_list.append((os.path.join(src_dir, file), dest_dir))
elif endswith is not None:
if file.endswith(endswith):
path_list.append((os.path.join(src_dir, file), dest_dir))
if startswith is None and endswith is None:
path_list.append((src_dir, dest_dir))
return path_list
conda_prefix = os.getenv("CONDA_PREFIX")
libos_files = include_files(os.path.join(conda_prefix, "lib"), os.path.join("shapely", ".libs"), startswith='libgeos')
py_files = include_files('wrfplot', '.', endswith='.py')
# Convert name list path to list to string
mpl_toolkits_dir = list(importlib.import_module('mpl_toolkits').__path__)[0]
mpl_toolkits_module = include_files(mpl_toolkits_dir, 'mpl_toolkits')
colormaps_module = os.path.dirname(importlib.machinery.PathFinder().find_module("colormaps").get_filename())
a = Analysis(
['wrfplot/wrfplot.py'],
pathex=[],
binaries=[],
datas=[('./wrfplot/data', 'data'), (colormaps_module, 'colormaps')] + libos_files + py_files + mpl_toolkits_module,
hiddenimports=['colormaps', 'tqdm'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
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='wrfplot',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='wrfplot',
)