AutoPercenty3/main.spec

179 lines
4.3 KiB
Python

# -*- mode: python ; coding: utf-8 -*-
import os
def collect_folder_excluding(folder_name, target_name=".", exclude_dirs=None):
"""
폴더 전체를 포함하되 특정 폴더를 제외하는 유틸리티 함수
- folder_name: 포함할 기본 폴더 경로
- target_name: 실행 파일 내에서의 대상 경로
- exclude_dirs: 제외할 폴더 이름 리스트
"""
datas = []
exclude_dirs = exclude_dirs or []
for root, dirs, files in os.walk(folder_name):
# 제외할 디렉토리 필터링
dirs[:] = [d for d in dirs if d not in exclude_dirs]
for file in files:
full_path = os.path.join(root, file)
relative_path = os.path.relpath(full_path, folder_name)
target_path = os.path.join(target_name, folder_name, relative_path)
datas.append((full_path, target_path))
return datas
# browsers 폴더에서 특정 폴더 제외
browsers_datas = collect_folder_excluding(
folder_name="browsers",
exclude_dirs=["user_data", "cache"]
)
block_cipher = None
a = Analysis(
['main.py'], # 프로젝트 메인 스크립트 이름
pathex=['.'], # 현재 경로
binaries=[],
datas=[
('leensoo1nt.json', '.'),
('prompt.json', '.'),
('config.ini', '.'),
('userDB.db', '.'),
('titleManager\kiprisCategories.json', '.'),
('HakgyoansimDunggeunmisoTTFB.ttf', '.'),
('src/initialDB.db', 'src'),
('src/Percenty_SS_Code.json', 'src')
] + browsers_datas,
hiddenimports=[
'playwright.async_api',
'PySide6.QtCore',
'PySide6.QtGui',
'PySide6.QtWidgets',
'win32gui',
'win32con',
'pyautogui',
'bs4',
'numpy',
'cv2',
'sqlalchemy',
'sqlalchemy.orm',
'sqlalchemy.exc',
'logging.handlers',
'PIL',
'pywinauto',
'vertexai.generative_models',
'pyperclip',
'ctypes',
'pandas'
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['PyQt5', 'PyQt5.sip', 'jinja2', 'pysqlite2', 'MySQLdb', 'psycopg2'],
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='AutoPercenty3', # 실행 파일 이름
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False, # 콘솔 창 비활성화
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='AutoPercenty3' # 최종 배포 폴더 이름
)
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(
['main.py'], # 프로젝트 메인 스크립트 이름
pathex=['.'], # 현재 경로
binaries=[],
datas=[
('leensoo1nt.json', '.'),
('prompt.json', '.'),
('config.ini', '.'),
('userDB.db', '.'),
('src/initialDB.db', 'src'),
('src/Percenty_SS_Code.json', 'src')
],
hiddenimports=[
'playwright.async_api',
'PySide6.QtCore',
'PySide6.QtGui',
'PySide6.QtWidgets',
'win32gui',
'win32con',
'pyautogui',
'bs4',
'numpy',
'cv2',
'sqlalchemy',
'sqlalchemy.orm',
'sqlalchemy.exc',
'logging.handlers',
'PIL',
'PIL.Image',
'PIL.ImageTk',
'pywinauto',
'vertexai.generative_models',
'pyperclip',
'ctypes',
'pandas'
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['PyQt5'],
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='AutoPercenty3', # 실행 파일 이름
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False, # 콘솔 창 비활성화
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='AutoPercenty3' # 최종 배포 폴더 이름
)