-
Notifications
You must be signed in to change notification settings - Fork 804
Expand file tree
/
Copy pathtchMaterial-parser.spec
More file actions
93 lines (84 loc) · 2.39 KB
/
Copy pathtchMaterial-parser.spec
File metadata and controls
93 lines (84 loc) · 2.39 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
# -*- mode: python ; coding: utf-8 -*-
import sys
from pathlib import Path
from PyInstaller.utils.hooks import collect_data_files
is_mac = sys.platform.startswith('darwin')
# sv-ttk 通过 Path(__file__).with_name() 加载主题文件,需把随包的 .tcl 与 .png 一并收集进来;图标文件是程序运行时读取的自有资源
runtime_assets = [
(str(path), "tchmaterial_parser/assets")
for path in Path("src/tchmaterial_parser/assets").glob("*.png")
]
data_files = collect_data_files("sv_ttk") + runtime_assets
a = Analysis(
# 入口位于包外:PyInstaller 会把入口脚本当作 __main__ 分析,包内脚本的相对导入在此情形下不成立
# pathex 指向 src/,使入口里的 import tchmaterial_parser 能被解析到
['src/main.py'],
pathex=['src'],
binaries=[],
datas=data_files,
# Pillow 的 _imagingtk 在非 Windows 平台通过 C 层动态导入此模块,PyInstaller 无法静态发现
hiddenimports=["PIL._tkinter_finder"],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
if is_mac:
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='tchMaterial-parser',
debug=False,
bootloader_ignore_signals=False,
strip=True,
upx=False,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='tchMaterial-parser',
)
app = BUNDLE(
coll,
name='tchMaterial-parser.app',
icon='assets/logo.icns',
bundle_identifier=None,
)
else:
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='tchMaterial-parser',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
version='version_info.txt',
icon=['assets/icon.ico'],
)