forked from joyeusenoelle/stitchify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_windows.py
More file actions
44 lines (37 loc) · 1.59 KB
/
Copy pathbuild_windows.py
File metadata and controls
44 lines (37 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
"""Build script for creating Windows executable with PyInstaller."""
import subprocess
import sys
from pathlib import Path
def build_exe():
"""Build standalone Windows executable."""
# PyInstaller command
cmd = [
'pyinstaller',
'--onefile', # Single executable file
'--name=pixelstitchifier', # Output name
'--icon=NONE', # Add icon path if you have one
'--add-data=src/pixelstitchifier/dmc_colors.csv:src/pixelstitchifier', # Include DMC database
'--hidden-import=PIL._tkinter_finder', # PIL dependencies
'--hidden-import=cv2', # OpenCV
'--hidden-import=sklearn', # scikit-learn
'--hidden-import=numpy', # NumPy
'--collect-all=PIL', # Collect all PIL modules
'--collect-all=cv2', # Collect all OpenCV modules
'--collect-all=sklearn', # Collect all sklearn modules
'src/pixelstitchifier/__main__.py', # Entry point
]
print("Building Windows executable...")
print(f"Command: {' '.join(cmd)}\n")
result = subprocess.run(cmd)
if result.returncode == 0:
print("\n✓ Build successful!")
print("Executable location: dist/pixelstitchifier.exe")
print("\nTo distribute:")
print("1. Copy dist/pixelstitchifier.exe to Windows computer")
print("2. Run from command prompt: pixelstitchifier.exe image.jpg --dmc")
else:
print("\n✗ Build failed!")
sys.exit(1)
if __name__ == '__main__':
build_exe()