-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpeekapi.spec
More file actions
40 lines (34 loc) · 981 Bytes
/
peekapi.spec
File metadata and controls
40 lines (34 loc) · 981 Bytes
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
# -*- mode: python ; coding: utf-8 -*-
# 使用方法: uv run pyinstaller peekapi.spec
import shutil
from pathlib import Path
a = Analysis(
['run.py'],
datas=[('peekapi.ico', '.')],
hiddenimports=[
'msgspec', 'msgspec.toml',
'soundcard', 'soundcard.mediafoundation',
'soundfile',
'numpy', 'numpy.core',
'PIL._tkinter_finder', 'pystray._win32', 'loguru',
],
excludes=['setuptools', 'tkinter', 'unittest', 'pydoc', 'difflib'],
)
pyz = PYZ(a.pure)
exe = EXE(
pyz, a.scripts, [],
exclude_binaries=True,
name='peekapi',
upx=True,
console=False,
icon='peekapi.ico',
version='version_info.txt',
)
coll = COLLECT(
exe, a.binaries, a.zipfiles, a.datas,
upx=True,
upx_exclude=['vcruntime140.dll', 'vcruntime140_1.dll', 'python*.dll', 'api-ms-*.dll', 'ucrtbase.dll'],
name='peekapi',
)
# 复制配置文件到 exe 同级
shutil.copy('config.toml', Path('dist/peekapi/config.toml'))