From c3623962c55969d3b642970973b0732d7fab5063 Mon Sep 17 00:00:00 2001 From: Carsten Kvist Date: Mon, 13 Apr 2026 13:31:27 +0200 Subject: [PATCH] Bygger hurtigere --- linedance-app/build_windows.spec | 89 ++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/linedance-app/build_windows.spec b/linedance-app/build_windows.spec index e56deb62..2e6dea68 100644 --- a/linedance-app/build_windows.spec +++ b/linedance-app/build_windows.spec @@ -1,57 +1,75 @@ # -*- mode: python ; coding: utf-8 -*- -from PyInstaller.utils.hooks import collect_all, collect_submodules block_cipher = None -# Saml ALT fra PyQt6 inkl. plugins og DLL-filer -pyqt6_datas, pyqt6_binaries, pyqt6_hiddenimports = collect_all('PyQt6') - a = Analysis( ['main.py'], pathex=['.'], - binaries=pyqt6_binaries, - datas=pyqt6_datas, - hiddenimports=pyqt6_hiddenimports + [ + binaries=[], + datas=[ + ('translations', 'translations'), + ], + hiddenimports=[ 'PyQt6.sip', 'PyQt6.QtCore', 'PyQt6.QtGui', 'PyQt6.QtWidgets', - # UI moduler - 'ui.main_window', - 'ui.playlist_panel', - 'ui.library_panel', - 'ui.library_manager', - 'ui.themes', - 'ui.vu_meter', - 'ui.scan_worker', - 'ui.tag_editor', - 'ui.login_dialog', - 'ui.settings_dialog', - 'ui.playlist_manager', - 'ui.next_up_bar', - # Player + local + 'PyQt6.QtNetwork', + 'ui.main_window', 'ui.playlist_panel', 'ui.library_panel', + 'ui.library_manager', 'ui.themes', 'ui.vu_meter', + 'ui.scan_worker', 'ui.bpm_worker', 'ui.tag_editor', + 'ui.settings_dialog', 'ui.playlist_browser', + 'ui.playlist_info_dialog', 'ui.dance_info_dialog', + 'ui.dance_picker_dialog', 'ui.share_dialog', + 'ui.register_dialog', 'player.player', - 'local.local_db', - 'local.tag_reader', - 'local.file_watcher', - # Biblioteker + 'local.local_db', 'local.scanner', 'local.file_watcher', + 'local.sync_manager', 'local.linked_playlist', + 'translations', 'translations.da', 'translations.en', 'mutagen', 'mutagen.mp3', 'mutagen.id3', 'mutagen.flac', 'mutagen.mp4', 'mutagen.oggvorbis', 'mutagen.ogg', 'mutagen.wave', 'mutagen.aiff', 'mutagen.asf', - 'watchdog', 'watchdog.observers', 'watchdog.events', - 'watchdog.observers.winapi', 'vlc', 'sqlite3', ], hookspath=[], - hooksconfig={}, runtime_hooks=[], - excludes=['tkinter', 'matplotlib', 'pandas', 'scipy', 'IPython'], - win_no_prefer_redirects=False, - win_private_assemblies=False, + excludes=[ + 'tkinter', 'tk', 'tcl', + 'matplotlib', 'pandas', 'scipy', 'numpy', + 'IPython', 'jupyter', 'PIL', 'cv2', 'sklearn', + 'PyQt6.QtWebEngine', 'PyQt6.QtWebEngineWidgets', + 'PyQt6.QtWebEngineCore', 'PyQt6.QtMultimedia', + 'PyQt6.QtMultimediaWidgets', 'PyQt6.QtBluetooth', + 'PyQt6.QtNfc', 'PyQt6.QtPositioning', 'PyQt6.QtLocation', + 'PyQt6.QtSensors', 'PyQt6.QtSerialPort', 'PyQt6.QtSql', + 'PyQt6.QtTest', 'PyQt6.QtXml', 'PyQt6.QtOpenGL', + 'PyQt6.QtOpenGLWidgets', 'PyQt6.Qt3DCore', 'PyQt6.Qt3DRender', + 'PyQt6.Qt3DInput', 'PyQt6.Qt3DLogic', 'PyQt6.Qt3DAnimation', + 'PyQt6.Qt3DExtras', 'PyQt6.QtCharts', 'PyQt6.QtDataVisualization', + 'PyQt6.QtQuick', 'PyQt6.QtQuickWidgets', 'PyQt6.QtQml', + 'PyQt6.QtRemoteObjects', 'PyQt6.QtScxml', 'PyQt6.QtStateMachine', + 'PyQt6.QtDesigner', 'PyQt6.QtHelp', 'PyQt6.QtPrintSupport', + 'unittest', 'doctest', 'pdb', 'pydoc', + ], cipher=block_cipher, noarchive=False, ) +# Fjern store ubrugte Qt DLL-filer +REMOVE_PATTERNS = [ + 'Qt6WebEngine', 'Qt6Quick', 'Qt6Qml', 'Qt6Designer', + 'Qt6Help', 'Qt6Multimedia', 'Qt6Location', 'Qt6Sensors', + 'Qt6Bluetooth', 'Qt6Nfc', 'Qt63D', 'Qt6Charts', + 'Qt6DataVisualization', 'Qt6RemoteObjects', 'Qt6Scxml', + 'Qt6StateMachine', 'Qt6VirtualKeyboard', + 'd3dcompiler', 'opengl32sw', +] +a.binaries = [ + (name, path, kind) + for name, path, kind in a.binaries + if not any(p.lower() in name.lower() for p in REMOVE_PATTERNS) +] + pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE( @@ -63,12 +81,8 @@ exe = EXE( debug=False, bootloader_ignore_signals=False, strip=False, - upx=False, # UPX kan give problemer med PyQt6 DLL-filer - console=False, # Ingen konsol-vindue - disable_windowed_traceback=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None, + upx=False, + console=False, icon=None, ) @@ -79,6 +93,5 @@ coll = COLLECT( a.datas, strip=False, upx=False, - upx_exclude=[], name='LineDancePlayer', )