-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreeze_setup.py
74 lines (62 loc) · 2.24 KB
/
freeze_setup.py
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
import sys
from cx_Freeze import Executable, setup
from constants import APP_ICON, SOURCES_FOLDER, VERSION
# Определение путей к недостающим библиотекам и включение Qt плагинов
libraries_path = [
# ("/home/test/Downloads/qtbase/lib/libQt6WebView.so.6", "./lib/libQt6WebView.so.6"),
]
include_files = [(SOURCES_FOLDER, "src")] + libraries_path
bin_path_includes = ["/home/test/Downloads/qtbase/lib"]
# Попытка импортировать функцию для определения путей к Qt плагинам
try:
from cx_Freeze.hooks import get_qt_plugins_paths
except ImportError:
get_qt_plugins_paths = None
if get_qt_plugins_paths:
# Включение дополнительных Qt плагинов
for plugin_name in (
"wayland-decoration-client",
"wayland-graphics-integration-client",
"wayland-shell-integration",
):
include_files += get_qt_plugins_paths("PyQt6", plugin_name)
# Платформо-специфичные настройки
if sys.platform == "win32":
# Добавляем файл только для Windows
include_files.append(("wget.exe", "wget.exe"))
bin_path_includes = []
# Зависимости приложения и настройки сборки
build_exe_options = {
"zip_include_packages": [
"sqlalchemy",
"PyQt6.QtWebEngineCore",
"PyQt6.QtWebEngineWidgets",
"PyQt6.QtWidgets",
"Qt6",
],
"packages": [
"sqlalchemy",
"html5lib",
"PyQt6",
"PyQt6.QtWebEngineCore",
"PyQt6.QtWebEngineWidgets",
"PyQt6.QtWidgets",
],
"excludes": [
"tk8.6",
"tkinter",
"unittest",
"black",
],
"include_files": include_files,
"bin_path_includes": bin_path_includes,
}
# base="Win32GUI" должен использоваться только для графических приложений Windows
base = "Win32GUI" if sys.platform == "win32" else None
setup(
name="WebAppReader",
version=VERSION,
description="Offline web content reader",
options={"build_exe": build_exe_options},
executables=[Executable("webappreader.py", base=base, icon=APP_ICON)],
)