# -*- mode: python ; coding: utf-8 -*-
import sys
from PyInstaller.utils.hooks import collect_data_files

block_cipher = None

# 1) grab ALL the ImGui assets (fonts, shaders, etc.) but NOT the .py files
datas = collect_data_files('imgui_bundle', include_py_files=False)

a = Analysis(
    ['calibrate_diode.py'],          # your main script
    pathex=['.'],                    # look in this folder
    binaries=[],
    datas=datas,                     # include ImGui assets here
    hiddenimports=[],                # add names if you get missing-module errors
    hookspath=[],
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
)

pyz = PYZ(
    a.pure,
    a.zipped_data,
    cipher=block_cipher,
)

exe = EXE(
    pyz,
    a.scripts,
    [],                              # no extra binaries in the EXE itself
    exclude_binaries=True,           # we'll collect them in the folder below
    name='calibrate_diode',          # name of the EXE
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=True,                    # set False for a windowed‐only app
)

coll = COLLECT(
    exe,
    a.binaries,
    a.zipfiles,
    a.datas,                         # this brings in your imgui_bundle/assets
    strip=False,
    upx=True,
    name='calibrate_diode',          # folder `dist/calibrate_diode/`
)
