VOC_Monitor/app/setup.py

65 lines
1.9 KiB
Python

import sys
from cx_Freeze import setup, Executable
import os
# 1. 포함할 파일 및 폴더 정의
# (소스 경로, 대상 경로) 튜플 또는 경로 문자열
include_files = [
("assets/", "assets/"),
("data/", "data/"),
("updater/config.json", "app/updater/config.json"),
]
# updater.exe 통합 (사전 빌드 산출물)
updater_exe_src = os.path.join("updater_build", "dist", "updater.exe")
if os.path.exists(updater_exe_src):
include_files.append((updater_exe_src, "updater.exe"))
else:
print("[setup.py] WARNING: updater.exe not found. Run 'python app/update_build_setup.py' first.")
# 2. 제외할 모듈 (용량 최적화용)
excludes = ["tkinter.test", "unittest"]
# 3. 필수 패키지 (자동 감지가 안될 경우 명시)
packages = [
"os", "sys", "json", "time", "threading", "schedule",
"customtkinter", "PIL", "pystray", "DrissionPage", "tkcalendar",
"selectolax", "winotify", "pywin32_system32", "services", "utils", "view", "models",
"requests", "urllib3",
"holidays",
"matplotlib", # 차트 생성
"openpyxl", # Excel 보고서
"reportlab", # PDF 보고서
"wordcloud", # 워드클라우드
# "pandas"
]
# 4. GUI 애플리케이션 설정 (Windows에서 콘솔 창 숨기기)
base = None
if sys.platform == "win32":
base = "Win32GUI"
# 5. 실행 파일 설정
executable = Executable(
script="main.py",
base=base,
target_name="VOC_Monitor.exe",
icon="assets/app_icon.ico" # 아이콘이 있다면 지정
)
# 6. Setup 실행
setup(
name="VOC_Notification_System",
version="1.0",
description="부산교통공사 VOC 모니터링 및 보고서 자동화 시스템",
options={
"build_exe": {
"packages": packages,
"excludes": excludes,
"include_files": include_files,
# "include_msvcr": True, # 필요한 경우 활성화
}
},
executables=[executable]
)