| import sys
|
| import subprocess
|
| import os
|
| from pathlib import Path
|
|
|
|
|
| entry_point = "snippet_extractor_v03alpha.py"
|
|
|
|
|
| cmd = [
|
| sys.executable,
|
| "-m", "PyInstaller",
|
| "--onefile",
|
| "--noconfirm",
|
| "--clean",
|
|
|
| "--hidden-import", "wx",
|
| "--hidden-import", "numpy",
|
| "--hidden-import", "rapidfuzz",
|
| "--hidden-import", "typing_extensions",
|
| ]
|
|
|
|
|
| cmd.append(entry_point)
|
|
|
|
|
| try:
|
| result = subprocess.run(cmd, check=True, capture_output=True, text=True)
|
| print("Compilation completed successfully.")
|
|
|
|
|
| if result.stderr:
|
| for line in result.stderr.split('\n'):
|
| if line.strip() and not line.startswith('['):
|
| print(f"PyInstaller: {line}")
|
|
|
| except subprocess.CalledProcessError as e:
|
| print(f"Error during compilation: {e}")
|
| print("Stderr:", e.stderr)
|
|
|
| except FileNotFoundError:
|
| print("PyInstaller not found. Please install it with 'pip install pyinstaller'")
|
|
|