Repository navigation
Expand file tree
/
Copy pathQuickModel.spec
More file actions
89 lines (83 loc) · 2.47 KB
/
Copy pathQuickModel.spec
File metadata and controls
89 lines (83 loc) · 2.47 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
# -*- mode: python ; coding: utf-8 -*-
import os
import sys
from PyInstaller.utils.hooks import collect_all, collect_data_files, copy_metadata
# rapidocr_onnxruntime 的 config.yaml 和 models/*.onnx 必须随包,
# 否则运行时报 "No such file or directory: .../rapidocr_onnxruntime/config.yaml"
_rapidocr_datas = collect_data_files('rapidocr_onnxruntime')
_mcp_datas = copy_metadata('mcp')
_anthropic_datas = copy_metadata('anthropic')
_playwright_datas, _playwright_binaries, _playwright_hiddenimports = collect_all('playwright')
_mcp_hiddenimports = [
'mcp.types',
'mcp.client.session',
'mcp.client.stdio',
'mcp.client.streamable_http',
]
_openssl_binaries = []
if os.name == 'nt':
for _dll_name in ('libssl-3-x64.dll', 'libcrypto-3-x64.dll'):
_dll_path = os.path.join(sys.prefix, 'Library', 'bin', _dll_name)
if os.path.isfile(_dll_path):
_openssl_binaries.append((_dll_path, '.'))
a = Analysis(
['main.py'],
pathex=[],
binaries=_openssl_binaries + _playwright_binaries,
datas=[('app/static', 'app/static'), ('icon.ico', '.')] + _rapidocr_datas + _mcp_datas + _anthropic_datas + _playwright_datas,
hiddenimports=[
'app.agent',
'app.tools',
'app.browser_tools',
'app.advanced_tools',
'app.skills',
'app.team',
'app.sync',
'app.webview_app',
'app.config',
'app.conversation',
'app.vision',
'app.mcp_client',
'app.model_protocol',
'anthropic',
'anthropic._client',
'anthropic.resources.messages',
'anthropic.types',
] + _mcp_hiddenimports + _playwright_hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
# onedir 打包(exclude_binaries=True + COLLECT):依赖放 _internal/ 文件夹,
# exe 直接用旁边依赖,不再每次解压 _MEI —— 根治 onefile 自更新后 Failed to load Python DLL。
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='QuickModel',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['icon.ico'],
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='QuickModel',
)