Repository navigation
Expand file tree
/
Copy pathFloatScreen.spec
More file actions
109 lines (102 loc) · 2.72 KB
/
Copy pathFloatScreen.spec
File metadata and controls
109 lines (102 loc) · 2.72 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
98
99
100
101
102
103
104
105
106
107
108
109
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller 打包配置。
RapidOCR 的特殊之处:
- 它通过 packages 目录下的 config.yaml 与 models/*.onnx 加载模型;
- 又通过 sys.path.append + importlib.import_module('ch_ppocr_v3_det') 之类
的「顶层模块名」动态导入子模块。
因此必须把 rapidocr_onnxruntime 的 .py / .yaml / .onnx 一并作为数据文件
放到磁盘上(保持包目录结构),并用 collect_submodules 兜底隐藏导入。
"""
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
hiddenimports = collect_submodules("rapidocr_onnxruntime")
datas = collect_data_files("rapidocr_onnxruntime", include_py_files=True)
# 明显用不到的 Qt 重量级模块,减小体积、缩短构建时间。
excludes = [
"tkinter",
"PySide6.QtWebEngineCore",
"PySide6.QtWebEngineWidgets",
"PySide6.QtWebEngineQuick",
"PySide6.QtQml",
"PySide6.QtQuick",
"PySide6.QtQuick3D",
"PySide6.QtQuickControls2",
"PySide6.QtQuickWidgets",
"PySide6.QtPdf",
"PySide6.QtPdfWidgets",
"PySide6.QtMultimedia",
"PySide6.QtMultimediaWidgets",
"PySide6.QtSpatialAudio",
"PySide6.QtCharts",
"PySide6.QtDataVisualization",
"PySide6.QtGraphs",
"PySide6.QtGraphsWidgets",
"PySide6.QtDesigner",
"PySide6.QtSql",
"PySide6.QtTest",
"PySide6.QtXml",
"PySide6.QtBluetooth",
"PySide6.QtDBus",
"PySide6.QtNfc",
"PySide6.QtSensors",
"PySide6.QtSerialPort",
"PySide6.QtSerialBus",
"PySide6.QtTextToSpeech",
"PySide6.QtWebChannel",
"PySide6.QtWebSockets",
"PySide6.QtLocation",
"PySide6.QtPositioning",
"PySide6.QtRemoteObjects",
"PySide6.QtScxml",
"PySide6.QtNetworkAuth",
"PySide6.QtHttpServer",
"PySide6.QtHelp",
"PySide6.QtUiTools",
"PySide6.Qt3DAnimation",
"PySide6.Qt3DCore",
"PySide6.Qt3DExtras",
"PySide6.Qt3DInput",
"PySide6.Qt3DLogic",
"PySide6.Qt3DRender",
"PySide6.QtConcurrent",
"PySide6.QtStateMachine",
]
a = Analysis(
["main.py"],
pathex=[],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=excludes,
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="FloatScreen",
icon="app.ico",
debug=False,
bootloader_ignore_signals=False,
strip=False,
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=False,
upx_exclude=[],
name="FloatScreen",
)