70 lines
1.9 KiB
Python
70 lines
1.9 KiB
Python
# -*- mode: python ; coding: utf-8 -*-
|
|
block_cipher = None
|
|
|
|
from PyInstaller.utils.hooks import collect_data_files
|
|
import os
|
|
|
|
# src 폴더의 모든 파일 포함
|
|
src_data = []
|
|
src_folder = "src"
|
|
|
|
for root, dirs, files in os.walk(src_folder):
|
|
for file in files:
|
|
# 파일 경로를 src 내부 상대 경로로 추가
|
|
full_path = os.path.join(root, file)
|
|
relative_path = os.path.relpath(full_path, src_folder)
|
|
src_data.append((full_path, os.path.join('src', relative_path)))
|
|
|
|
# 분석 설정
|
|
a = Analysis(
|
|
['main.py'], # 메인 스크립트 파일
|
|
pathex=[], # 추가 탐색 경로 (필요하면 추가 가능)
|
|
binaries=[], # 바이너리 파일 (필요시 추가)
|
|
datas=[
|
|
('filter_cat.ini', '.'), # ini 파일
|
|
('xls', 'xls'), # xls 폴더
|
|
('img', 'img'), # img 폴더
|
|
], # 추가할 데이터 파일 및 폴더
|
|
hiddenimports=['skimage.exposure'],
|
|
hookspath=[], # 추가 hook 파일 경로
|
|
runtime_hooks=[], # 런타임 hook
|
|
excludes=[], # 제외할 모듈
|
|
win_no_prefer_redirects=False,
|
|
win_private_assemblies=False,
|
|
cipher=block_cipher,
|
|
noarchive=False, # 압축하지 않음
|
|
)
|
|
|
|
# 압축 관련 설정
|
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
|
|
|
# 실행 파일 설정
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
[],
|
|
exclude_binaries=True,
|
|
name='SellFree소서', # 생성된 실행 파일 이름
|
|
debug=False,
|
|
bootloader_ignore_signals=False,
|
|
strip=False,
|
|
upx=True, # UPX 압축 사용
|
|
console=False, # 콘솔 창 숨기기
|
|
disable_windowed_traceback=False,
|
|
target_arch=None,
|
|
codesign_identity=None,
|
|
entitlements_file=None,
|
|
)
|
|
|
|
# 파일 수집 설정
|
|
coll = COLLECT(
|
|
exe,
|
|
a.binaries,
|
|
a.zipfiles,
|
|
a.datas,
|
|
strip=False,
|
|
upx=True,
|
|
upx_exclude=[],
|
|
name='SellFreeSourcer', # 생성된 디렉터리 이름
|
|
)
|