forked from epcpower/pm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyinstaller.spec
64 lines (52 loc) · 1.26 KB
/
pyinstaller.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
# -*- mode: python -*-
import os
import pathlib
def collect(prefix, search_in, *extensions):
for dir_name, subdirs, files in os.walk(search_in):
for filename in (f for f in files if f.endswith(extensions)):
filename = pathlib.Path(dir_name, filename)
yield (filename, pathlib.Path(dir_name).relative_to(prefix))
data_files = []
name = 'mpm'
prefix = pathlib.Path('src')
search_in = prefix
extensions = ['.ui', '.ico', '.png', '.svg', '.pmp', '.json']
data_files.extend(collect(prefix, search_in, *extensions))
a = Analysis(
[str(pathlib.Path('src', name, '__main__.py'))],
pathex=['..'],
binaries=[],
datas=[(str(pathlib.Path(p).resolve()), pp) for p, pp in data_files],
hiddenimports=['canmatrix.sym'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=None,
)
pyz = PYZ(
a.pure,
a.zipped_data,
cipher=None,
)
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name=name,
debug=False,
strip=False,
upx=True,
console=False,
icon=str(pathlib.Path('src', name, 'icon.ico')),
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name=name,
)