Build Windows executable
(self)
| 465 | return str(spec_path) |
| 466 | |
| 467 | def build_executable(self) -> bool: |
| 468 | """Build Windows executable""" |
| 469 | logger.step("Building Windows Executable") |
| 470 | |
| 471 | try: |
| 472 | # Create spec file |
| 473 | spec_path = self.create_pyinstaller_spec() |
| 474 | |
| 475 | # Run PyInstaller |
| 476 | logger.info("Starting PyInstaller build...") |
| 477 | run_command(f"pyinstaller {spec_path} --clean --noconfirm --distpath dist", timeout=600) |
| 478 | |
| 479 | # Verify executable was created |
| 480 | exe_path = self.build_env.dist_dir / f'{PROJECT_NAME}-v{VERSION}.exe' |
| 481 | if not exe_path.exists(): |
| 482 | logger.error(f"Executable not found: {exe_path}") |
| 483 | return False |
| 484 | |
| 485 | size = exe_path.stat().st_size |
| 486 | logger.success(f"Executable built: {exe_path.name} ({size:,} bytes, {size/1024/1024:.2f} MB)") |
| 487 | |
| 488 | # Clean up spec file |
| 489 | if self.spec_file and self.spec_file.exists(): |
| 490 | self.spec_file.unlink() |
| 491 | |
| 492 | return True |
| 493 | |
| 494 | except BuildError as e: |
| 495 | logger.error(f"Executable build failed: {e}") |
| 496 | return False |
| 497 | |
| 498 | class PortablePackageBuilder: |
| 499 | """Cross-platform portable package creation""" |
nothing calls this directly
no test coverage detected