-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_aws.py
More file actions
70 lines (59 loc) · 2.04 KB
/
build_aws.py
File metadata and controls
70 lines (59 loc) · 2.04 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python3
"""
AWS 데이터셋 큐레이션 앱 빌드 스크립트
"""
import subprocess
import sys
import shutil
import os
from pathlib import Path
def clean_build():
"""이전 빌드 파일 정리"""
for dir_name in ['build', 'dist', '__pycache__']:
if os.path.exists(dir_name):
shutil.rmtree(dir_name)
print("Cleaned previous build files")
def check_dependencies():
"""필요한 의존성 확인"""
required_packages = ['PyInstaller', 'PySide6', 'boto3', 'requests', 'PIL']
for package in required_packages:
try:
__import__(package)
print(f"OK: {package} found")
except ImportError:
print(f"ERROR: {package} not installed")
sys.exit(1)
def build_app():
"""앱 빌드"""
print("Starting AWS app build...")
# 의존성 확인
check_dependencies()
# 클린 빌드
clean_build()
# PyInstaller 실행
cmd = [sys.executable, '-m', 'PyInstaller', 'aws_app.spec']
try:
print(f"Running: {' '.join(cmd)}")
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
print("Build successful!")
# 결과 확인
dist_path = Path('dist')
if dist_path.exists():
if sys.platform == 'darwin':
app_path = dist_path / 'AWS Data Curator.app'
if app_path.exists():
print(f"macOS app created: {app_path}")
elif sys.platform.startswith('win'):
exe_path = dist_path / 'AWS_Data_Curator.exe'
if exe_path.exists():
print(f"Windows executable created: {exe_path}")
else:
exe_path = dist_path / 'AWS_Data_Curator'
if exe_path.exists():
print(f"Linux executable created: {exe_path}")
except subprocess.CalledProcessError as e:
print("Build failed!")
print(f"Error: {e.stderr}")
sys.exit(1)
if __name__ == '__main__':
build_app()