Create comprehensive PyInstaller spec file
(self)
| 398 | self.spec_file = None |
| 399 | |
| 400 | def create_pyinstaller_spec(self) -> str: |
| 401 | """Create comprehensive PyInstaller spec file""" |
| 402 | spec_content = f'''# -*- mode: python ; coding: utf-8 -*- |
| 403 | # {PROJECT_NAME} v{VERSION} PyInstaller Specification |
| 404 | # Generated: {BUILD_TIMESTAMP} |
| 405 | |
| 406 | block_cipher = None |
| 407 | |
| 408 | a = Analysis( |
| 409 | ['main.py'], |
| 410 | pathex=[], |
| 411 | binaries=[], |
| 412 | datas=[ |
| 413 | ('augment_tools_core', 'augment_tools_core'), |
| 414 | ('gui_qt6', 'gui_qt6'), |
| 415 | ('languages', 'languages'), |
| 416 | ('config', 'config'), |
| 417 | ('README.md', '.'), |
| 418 | ('requirements.txt', '.'), |
| 419 | ], |
| 420 | hiddenimports=[ |
| 421 | 'PyQt6', 'PyQt6.QtWidgets', 'PyQt6.QtCore', 'PyQt6.QtGui', |
| 422 | 'tkinter', 'tkinter.ttk', 'tkinter.messagebox', 'tkinter.filedialog', |
| 423 | 'click', 'colorama', 'pathlib', 'sqlite3', 'json', 'uuid', |
| 424 | 'platform', 'subprocess', 'threading', 'queue', 'time', 'psutil', |
| 425 | 'xml.etree.ElementTree', 'shutil', 'tempfile' |
| 426 | ], |
| 427 | hookspath=[], |
| 428 | hooksconfig={{}}, |
| 429 | runtime_hooks=[], |
| 430 | excludes=['matplotlib', 'numpy', 'pandas', 'scipy', 'PIL'], |
| 431 | win_no_prefer_redirects=False, |
| 432 | win_private_assemblies=False, |
| 433 | cipher=block_cipher, |
| 434 | noarchive=False, |
| 435 | ) |
| 436 | |
| 437 | pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) |
| 438 | |
| 439 | exe = EXE( |
| 440 | pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], |
| 441 | name='{PROJECT_NAME}-v{VERSION}', |
| 442 | debug=False, |
| 443 | bootloader_ignore_signals=False, |
| 444 | strip=False, |
| 445 | upx=True, |
| 446 | upx_exclude=[], |
| 447 | runtime_tmpdir=None, |
| 448 | console=True, |
| 449 | disable_windowed_traceback=False, |
| 450 | argv_emulation=False, |
| 451 | target_arch=None, |
| 452 | codesign_identity=None, |
| 453 | entitlements_file=None, |
| 454 | ) |
| 455 | ''' |
| 456 | |
| 457 | spec_filename = f'{PROJECT_NAME}-v{VERSION}.spec' |
no test coverage detected