-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlidar2map_win_launcher.spec
More file actions
95 lines (84 loc) · 3.19 KB
/
Copy pathlidar2map_win_launcher.spec
File metadata and controls
95 lines (84 loc) · 3.19 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
# -*- mode: python ; coding: utf-8 -*-
"""
Spec PyInstaller pour le LAUNCHER lidar2map — Windows onefile.
Construit la même source lidar2map.py en mode onefile minimal, en excluant
toutes les deps lourdes (le launcher n'utilise que stdlib).
Le bundle lidar2map_bundle.zip N'EST PAS embarqué dans le binaire : il est
copié à côté du .exe par lidar2map_win_build.ps1, ce qui le rend remplaçable
sans rebuilder (cf. update_app.py / 7-Zip).
Au runtime, le bloc launcher en tête de lidar2map.py cherche le bundle
à côté de l'exe, puis spawn l'exe interne avec la sentinelle
--__lidar2map_inner__ qui désactive ce même bloc côté inner.
Prérequis (orchestré par lidar2map_win_build.ps1) :
1. pyinstaller lidar2map_win.spec -> dist_onedir/lidar2map/...
2. zip dist_onedir/lidar2map -> build/lidar2map_bundle.zip
3. pyinstaller lidar2map_win_launcher.spec -> dist/lidar2map.exe (livrable final)
4. copie lidar2map_bundle.zip -> dist/ (à côté du .exe)
"""
from pathlib import Path
BUNDLE_ZIP = Path(SPECPATH) / "build" / "lidar2map_bundle.zip"
APP_ICON = Path(SPECPATH) / "lidar2map_icon.png"
if not BUNDLE_ZIP.exists():
raise SystemExit(
f"[lidar2map_win_launcher.spec] Bundle introuvable : {BUNDLE_ZIP}\n"
"Exécute d'abord :\n"
" pyinstaller lidar2map_win.spec --clean --noconfirm\n"
" Compress-Archive dist_onedir\\lidar2map\\* build\\lidar2map_bundle.zip\n"
)
# Le zip N'EST PAS embarqué dans le binaire launcher.
# Il sera copié à côté du .exe par lidar2map_win_build.ps1.
# → Remplaçable depuis Windows sans rebuilder : ouvrir le zip, remplacer _internal/lidar2map.py
datas = []
hiddenimports = []
# Exclure agressivement toutes les deps lourdes — le launcher n'utilise
# que stdlib (os, sys, hashlib, zipfile, subprocess, shutil, pathlib).
# Sans ça PyInstaller les analyse statiquement → exe énorme.
excludes = [
"rasterio", "fiona", "shapely", "pyproj",
"scipy", "numba", "llvmlite",
"numpy",
"PIL", "Pillow",
"webview", "clr_loader", "pythonnet", "clr",
"osmium",
"laspy", # ajout
"CSF", # socle DFM csf (lazy dans common)
"py7zr", # ajout
"mapbox_vector_tile", "google.protobuf",
"ijson",
"requests", "urllib3", "charset_normalizer", "certifi",
"pandas",
"tkinter", "matplotlib",
"PyQt5", "PyQt6", "PySide2", "PySide6",
"test", "unittest", "pydoc_data", "IPython", "jupyter",
]
a = Analysis(
["lidar2map.py"],
pathex=[],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=excludes,
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz, a.scripts, a.binaries, a.datas, [],
name="lidar2map",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=True, # stdout du child visible dans le terminal
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=str(APP_ICON),
)