2026-01-04 20:37:30 +01:00
|
|
|
# -*- mode: python ; coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
PyInstaller Konfiguration für DocuMentor
|
|
|
|
|
Erstellt eine eigenständige Windows-Executable ohne Python-Installation
|
|
|
|
|
"""
|
|
|
|
|
|
2026-02-15 19:51:58 +01:00
|
|
|
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,
|
2026-01-18 17:55:17 +01:00
|
|
|
hiddenimports=[
|
|
|
|
|
'PySide6.QtCore',
|
|
|
|
|
'PySide6.QtGui',
|
|
|
|
|
'PySide6.QtWidgets',
|
|
|
|
|
'pydantic',
|
|
|
|
|
'pydantic_settings',
|
|
|
|
|
'pydantic_yaml',
|
|
|
|
|
'polars',
|
|
|
|
|
'pyarrow',
|
2026-02-15 19:51:58 +01:00
|
|
|
] + cx_hiddenimports,
|
2026-01-04 20:37:30 +01:00
|
|
|
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='DocuMentor',
|
|
|
|
|
debug=False,
|
|
|
|
|
bootloader_ignore_signals=False,
|
|
|
|
|
strip=False,
|
|
|
|
|
upx=True,
|
|
|
|
|
console=False, # Keine Konsole anzeigen (GUI-Anwendung)
|
|
|
|
|
disable_windowed_traceback=False,
|
|
|
|
|
argv_emulation=False,
|
|
|
|
|
target_arch=None,
|
|
|
|
|
codesign_identity=None,
|
|
|
|
|
entitlements_file=None,
|
|
|
|
|
icon=str(project_root / 'resources' / 'icon.ico') if (project_root / 'resources' / 'icon.ico').exists() else None,
|
|
|
|
|
version=str(project_root / 'version_info.txt') if (project_root / 'version_info.txt').exists() else None,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
coll = COLLECT(
|
|
|
|
|
exe,
|
|
|
|
|
a.binaries,
|
|
|
|
|
a.zipfiles,
|
|
|
|
|
a.datas,
|
|
|
|
|
strip=False,
|
|
|
|
|
upx=True,
|
|
|
|
|
upx_exclude=[],
|
|
|
|
|
name='DocuMentor',
|
|
|
|
|
)
|