# PyInstaller spec for MTGA Assistant: a one-folder, windowed build. # Build on the target OS (PyInstaller can't cross-compile), e.g. on Windows: # powershell -ExecutionPolicy Bypass -File packaging\build_windows.ps1 import sys from pathlib import Path ROOT = Path(SPECPATH).parent SRC = ROOT / "src" a = Analysis( [str(ROOT / "packaging" / "launch.py")], pathex=[str(SRC)], datas=[(str(SRC / "mtga_assistant" / "icon.png"), "mtga_assistant")], # Qt modules the app doesn't use; keeps the bundle smaller. excludes=[ "tkinter", "PySide6.QtQml", "PySide6.QtQuick", "PySide6.QtSql", "PySide6.QtTest", "PySide6.QtOpenGL", "PySide6.QtPdf", ], noarchive=False, ) # Not needed by a Qt Widgets app: the software OpenGL fallback (~20 MB) and Qt's translations. a.binaries = [b for b in a.binaries if Path(b[0]).name.lower() != "opengl32sw.dll"] a.datas = [d for d in a.datas if "translations" not in Path(d[0]).parts] pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, [], exclude_binaries=True, name="MTGA Assistant", console=False, icon=str(ROOT / "images" / "mtga-assistant-icon.ico") if sys.platform == "win32" else None, ) coll = COLLECT(exe, a.binaries, a.datas, name="MTGA Assistant")