-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphate.spec
More file actions
109 lines (95 loc) · 2.84 KB
/
graphate.spec
File metadata and controls
109 lines (95 loc) · 2.84 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 -*-
"""Сборка исполняемого файла graphate.exe (папка dist/graphate/)."""
import os
from pathlib import Path
from PyInstaller.building.api import COLLECT, EXE, PYZ
from PyInstaller.building.build_main import Analysis
from PyInstaller.utils.hooks import collect_all, collect_data_files, collect_submodules
block_cipher = None
spec_dir = Path(os.path.dirname(os.path.abspath(SPEC))).resolve()
entry = spec_dir / "graphate_entry.py"
p6_datas, p6_bins, p6_hidden = collect_all("PySide6")
try:
rio_datas, rio_bins, rio_hidden = collect_all("rasterio")
except Exception:
rio_datas, rio_bins, rio_hidden = [], [], []
# Подмодули вроде rasterio.serde PyInstaller часто не тянет из одного импорта warp/enums.
try:
rio_submods = collect_submodules("rasterio")
except Exception:
rio_submods = []
extra_datas: list = []
for pkg in ("pyproj", "rasterio"):
try:
extra_datas += collect_data_files(pkg)
except Exception:
pass
# rasterio.serde — чистый .py, но импортируется из rasterio._base (Cython); PyInstaller не кладёт в PYZ.
# Копируем файл рядом с пакетом; graphate_entry._bootstrap_rasterio_serde() подхватывает до import rasterio.
try:
import rasterio as _rio_mod
_serde_py = Path(_rio_mod.__file__).resolve().parent / "serde.py"
if _serde_py.is_file():
extra_datas.append((str(_serde_py), "rasterio"))
except Exception:
pass
a = Analysis(
[str(entry)],
pathex=[str(spec_dir)],
binaries=p6_bins + rio_bins,
datas=p6_datas + rio_datas + extra_datas,
hiddenimports=p6_hidden
+ rio_hidden
+ rio_submods
+ [
"app",
"app.main",
"app.gui.main_window",
"app.gui.canvas",
"app.gui.graph_scene",
"app.gui.map_view",
"app.gui.basemap_provider",
"app.gui.configuration_dialog",
"app.gui.reachability_worker",
"app.config.user_settings",
"matplotlib.backends.backend_qtagg",
"PIL",
"rasterio.serde",
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="graphate",
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,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="graphate",
)