42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
from cx_Freeze import setup, Executable
|
|
import sys
|
|
import os
|
|
|
|
# base 옵션: 콘솔/GUI 구분 (여기서는 콘솔)
|
|
base = None
|
|
if sys.platform == "win32":
|
|
base = "Console"
|
|
|
|
# # requirements.txt에서 패키지 목록 읽기 (참고용, 실제로는 pip로 설치 필요)
|
|
# with open("requirements.txt", "r", encoding="utf-8") as f:
|
|
# install_requires = [
|
|
# line.strip().split("#")[0]
|
|
# for line in f
|
|
# if line.strip() and not line.startswith("#")
|
|
# ]
|
|
|
|
# 추가로 포함할 파일/폴더 지정
|
|
include_files = [
|
|
("modules", "modules"), # modules 폴더 전체 포함
|
|
]
|
|
|
|
setup(
|
|
name="ImageTranslateServer",
|
|
version="1.0",
|
|
description="이미지 번역 FastAPI 서버",
|
|
options={
|
|
"build_exe": {
|
|
# 문제가 되는 대형 패키지들 제외하고 최소한만
|
|
"include_files": include_files,
|
|
"excludes": [
|
|
"tkinter", "matplotlib", "paddle", "torch", "torchvision",
|
|
"paddleocr", "iopaint", "test", "unittest", "pdb"
|
|
],
|
|
"include_msvcr": True,
|
|
"optimize": 2,
|
|
}
|
|
},
|
|
executables=[
|
|
Executable("main.py", base=base, target_name="ImageTranslateServer.exe")
|
|
]
|
|
) |