Fix: PyInstaller-Bundle für installierte Version repariert (connectorx, SQL-Ressourcen)
- connectorx via collect_all() eingebunden statt hiddenimports (Rust-PYD + __init__.py + Metadaten als Einheit) - SQL/CSV-Ressourcen (src/res/) ins PyInstaller-Bundle aufgenommen - Pfadauflösung in database.py auf sys._MEIPASS umgestellt für installierten Modus - connectorx als explizite Abhängigkeit in pyproject.toml ergänzt - Dokumentation (windows_distribution.md) um collect_all-Pattern und _MEIPASS-Hinweise erweitert - Version auf 1.0.0 aktualisiert, Hersteller-Informationen ergänzt
This commit is contained in:
+31
-21
@@ -4,25 +4,36 @@ PyInstaller Konfiguration für DocuMentor
|
||||
Erstellt eine eigenständige Windows-Executable ohne Python-Installation
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
block_cipher = None
|
||||
|
||||
# Projektpfad
|
||||
project_root = Path(SPECPATH)
|
||||
src_path = project_root / 'src'
|
||||
|
||||
# Alle UI-Dateien sammeln
|
||||
ui_files = []
|
||||
for ui_file in (src_path / 'ui').glob('*.ui'):
|
||||
ui_files.append((str(ui_file), 'ui'))
|
||||
|
||||
a = Analysis(
|
||||
[str(src_path / 'main.py')],
|
||||
pathex=[str(src_path)],
|
||||
binaries=[],
|
||||
datas=ui_files, # UI-Dateien einbinden
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from PyInstaller.utils.hooks import collect_all
|
||||
|
||||
block_cipher = None
|
||||
|
||||
# Projektpfad
|
||||
project_root = Path(SPECPATH)
|
||||
src_path = project_root / 'src'
|
||||
|
||||
# connectorx komplett sammeln (Python-Code, native .pyd und Metadaten)
|
||||
# PyInstaller erkennt connectorx nicht automatisch, da es zur Laufzeit
|
||||
# von polars per importlib.import_module() geladen wird
|
||||
cx_datas, cx_binaries, cx_hiddenimports = collect_all('connectorx')
|
||||
|
||||
# Alle UI-Dateien sammeln
|
||||
ui_files = []
|
||||
for ui_file in (src_path / 'ui').glob('*.ui'):
|
||||
ui_files.append((str(ui_file), 'ui'))
|
||||
|
||||
# Ressource-Dateien (SQL, CSV) einbinden
|
||||
res_files = []
|
||||
for res_file in (src_path / 'res').glob('*'):
|
||||
res_files.append((str(res_file), 'res'))
|
||||
|
||||
a = Analysis(
|
||||
[str(src_path / 'main.py')],
|
||||
pathex=[str(src_path)],
|
||||
binaries=cx_binaries,
|
||||
datas=ui_files + res_files + cx_datas,
|
||||
hiddenimports=[
|
||||
'PySide6.QtCore',
|
||||
'PySide6.QtGui',
|
||||
@@ -32,8 +43,7 @@ a = Analysis(
|
||||
'pydantic_yaml',
|
||||
'polars',
|
||||
'pyarrow',
|
||||
'connectorx',
|
||||
],
|
||||
] + cx_hiddenimports,
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
|
||||
Reference in New Issue
Block a user