import os import subprocess import sys def build_executable(): # Ensure we're in the project root directory os.chdir(os.path.dirname(os.path.abspath(__file__))) # Install required packages using uv print("Installing required packages...") subprocess.run(["uv", "pip", "install", "-r", "requirements.txt"], check=True) # Build the executable using PyInstaller print("Building executable...") subprocess.run([ "pyinstaller", "--name=ExcelConverter", "--onefile", "--windowed", "--add-data=employee_info.json;.", "--add-data=company_options.json;.", "--add-data=bank_options.json;.", "--add-data=template.xlsx;.", "--add-data=config.py;.", "app.py" ], check=True) print("Build completed successfully!") print("The executable can be found in the 'dist' directory.") if __name__ == "__main__": build_executable()