Files
kadastr14/build_script.py

42 lines
1.8 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
Скрипт для создания исполняемого файла программы
"""
import PyInstaller.__main__
import sys
import os
def build_executable():
"""Создает исполняемый файл без консоли"""
# Параметры для PyInstaller
args = [
'main.py', # Главный файл
'--onefile', # Один исполняемый файл
'--windowed', # Без консоли (для GUI приложений)
'--name=KadastrParser', # Имя исполняемого файла
'--icon=NONE', # Без иконки
'--add-data=services;services', # Включаем папку services
'--add-data=models;models', # Включаем папку models
'--hidden-import=tkinter', # Явно включаем tkinter
'--hidden-import=pandas', # Явно включаем pandas
'--hidden-import=openpyxl', # Явно включаем openpyxl
'--hidden-import=lxml', # Явно включаем lxml
'--clean', # Очищаем кэш
'--noconfirm', # Не запрашиваем подтверждение
]
print("🚀 Начинаем создание исполняемого файла...")
print("📋 Параметры сборки:")
for arg in args:
print(f" {arg}")
print()
# Запускаем PyInstaller
PyInstaller.__main__.run(args)
print("✅ Сборка завершена!")
print("📁 Исполняемый файл находится в папке 'dist'")
if __name__ == "__main__":
build_executable()