-
-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathswingmusic.spec
More file actions
97 lines (89 loc) · 2.8 KB
/
swingmusic.spec
File metadata and controls
97 lines (89 loc) · 2.8 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
# -*- mode: python ; coding: utf-8 -*-
import argparse
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
from platform import system, machine
import pathlib
# Build mode is chosen via args after `--`, per the canonical PyInstaller
# pattern (see: https://pyinstaller.org/en/stable/spec-files):
# pyinstaller swingmusic.spec -> onefile (single executable)
# pyinstaller swingmusic.spec -- --onedir -> onedir at dist/swingmusic/
parser = argparse.ArgumentParser()
parser.add_argument("--onedir", action="store_true",
help="Build as a directory tree instead of a single executable")
options = parser.parse_args()
# PyInstaller can't see inside Nuitka-compiled .so/.pyd files to discover
# their imports. Rather than manually tracking which modules the compiled
# premium code needs, pull in every swingmusic submodule unconditionally.
hiddenimports = collect_submodules('swingmusic')
datas = [('client.zip', '.'), ('version.txt', '.')]
datas += collect_data_files('swingmusic', True, excludes=['**/*.py'], includes=['**/*.*'])
datas += collect_data_files('flask_openapi3', True, excludes=['**/*.py'], includes=['**/*.*'])
def getFlaskOpenApiPath():
return importlib.resources.files("flask_openapi3")
binary_name = f'swingmusic_{system().lower()}_{machine().lower()}'
a = Analysis(
['run.py'],
pathex=['src'],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
if options.onedir:
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name=binary_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=[pathlib.Path('src\\swingmusic\\assets\\logo-fill.light.ico')],
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='swingmusic',
)
else:
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name=binary_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=[pathlib.Path('src\\swingmusic\\assets\\logo-fill.light.ico')],
)