From 18c708597abf4240894f682c3cc5265ada03e3a5 Mon Sep 17 00:00:00 2001 From: Xarkam Date: Mon, 9 Mar 2026 12:52:05 +0100 Subject: [PATCH] Retrait win11toast et compilation agressive via fichier spec --- La Tanière Launcher.spec | 133 +++++++++++++++++++++++++++++++++++++++ src/mainwindow.py | 9 +-- 2 files changed, 134 insertions(+), 8 deletions(-) create mode 100644 La Tanière Launcher.spec diff --git a/La Tanière Launcher.spec b/La Tanière Launcher.spec new file mode 100644 index 0000000..a74f7f3 --- /dev/null +++ b/La Tanière Launcher.spec @@ -0,0 +1,133 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['src\\mainwindow.py'], + pathex=[], + binaries=[], + datas=[ + ('.\\styles\\styles.qss', 'styles'), + ('.\\ui\\mainwindow.ui', 'ui') + ], + hiddenimports=[], + hookspath=[], + hooksconfig={ + "qt_plugins": ["platforms", "styles"] + }, + runtime_hooks=[], + excludes=[ + # PySide6 - modules non utilisés + 'PySide6.Qt3DAnimation', + 'PySide6.Qt3DCore', + 'PySide6.Qt3DExtras', + 'PySide6.Qt3DInput', + 'PySide6.Qt3DLogic', + 'PySide6.Qt3DRender', + 'PySide6.QtAxContainer', + 'PySide6.QtBluetooth', + 'PySide6.QtCharts', + 'PySide6.QtConcurrent', + 'PySide6.QtDataVisualization', + 'PySide6.QtDesigner', + 'PySide6.QtHelp', + 'PySide6.QtLocation', + 'PySide6.QtMultimedia', + 'PySide6.QtMultimediaWidgets', + 'PySide6.QtNetwork', + 'PySide6.QtNetworkAuth', + 'PySide6.QtNfc', + 'PySide6.QtOpenGL', + 'PySide6.QtOpenGLWidgets', + 'PySide6.QtPdf', + 'PySide6.QtPdfWidgets', + 'PySide6.QtPositioning', + 'PySide6.QtPrintSupport', + 'PySide6.QtQml', + 'PySide6.QtQuick', + 'PySide6.QtQuick3D', + 'PySide6.QtQuickControls2', + 'PySide6.QtQuickWidgets', + 'PySide6.QtRemoteObjects', + 'PySide6.QtScxml', + 'PySide6.QtSensors', + 'PySide6.QtSerialBus', + 'PySide6.QtSerialPort', + 'PySide6.QtSpatialAudio', + 'PySide6.QtSql', + 'PySide6.QtStateMachine', + 'PySide6.QtSvg', + 'PySide6.QtSvgWidgets', + 'PySide6.QtTest', + 'PySide6.QtTextToSpeech', + 'PySide6.QtWebChannel', + 'PySide6.QtWebEngineCore', + 'PySide6.QtWebEngineQuick', + 'PySide6.QtWebEngineWidgets', + 'PySide6.QtWebSockets', + 'PySide6.QtXml', + + # Stdlib inutile en prod + 'unittest', + 'email', + 'html', + 'http', + 'xmlrpc', + 'pydoc', + 'doctest', + 'difflib', + 'tkinter', + 'curses', + 'readline', + 'xml', + 'xmlrpc', + 'csv', + 'multiprocessing', + 'concurrent', + 'asyncio', # non utilisé dans ton code + 'sqlite3', + 'ssl', + 'socket', # win11toast peut en avoir besoin, à tester + 'ctypes', # idem, à tester + 'lib2to3', + 'test', + 'distutils', + 'setuptools', + 'pkg_resources', + 'pip', + ], + noarchive=False, + optimize=2, # optimisation bytecode +) +pyz = PYZ(a.pure, a.zipped_data) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='La Tanière Launcher', + debug=False, + bootloader_ignore_signals=False, + strip=False, # True = enlève symboles debug + upx=True, + upx_exclude=[ + "_uuid.pyd", + "Qt6Core.dll", + "Qt6Gui.dll", + "Qt6Widgets.dll", + "Qt6UiTools.dll", + "qwindows.dll", + "python3*.dll", + "vcruntime*.dll", + "msvcp*.dll", + ], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=True, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['assets\\Icone.ico'], +) diff --git a/src/mainwindow.py b/src/mainwindow.py index 2cd2ed8..28365fe 100644 --- a/src/mainwindow.py +++ b/src/mainwindow.py @@ -12,9 +12,6 @@ from PySide6.QtWidgets import QMainWindow, QApplication import resources as resources # This is generated from the .qrc file # noqa: F401 -if sys.platform=='windows' or sys.platform=="win32": - from win11toast import toast # type: ignore - if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): bundle_dir = Path(sys._MEIPASS) else: @@ -87,11 +84,7 @@ class MainWindow(QMainWindow): @staticmethod def connexion_btn_link(): - buttons = [ - {'activationType': 'protocol', 'arguments': '', 'content': 'Entrer en jeu'}, - ] - if sys.platform=='windows' or sys.platform=="win32": - toast('C\'est enfin à ton tour d\'entrer en jeu! 🎮🐍', app_id='LaTanière Launcher',buttons=buttons) + return None if __name__ == "__main__": app = QApplication(sys.argv)