# -*- mode: python ; coding: utf-8 -*- # PyInstaller spec for the Niimbot label designer. # Windows: pyinstaller label_app.spec -> dist/NiimbotLabel.exe # Linux: pyinstaller label_app.spec -> dist/NiimbotLabel # Build on the target OS; PyInstaller does not cross-compile. import sys from pathlib import Path from PyInstaller.utils.hooks import collect_data_files ROOT = Path(SPECPATH) datas = [ (str(ROOT / "assets" / "fonts"), "assets/fonts"), *collect_data_files("emoji_data_python"), # emoji.json *collect_data_files("ttkbootstrap"), # themes ] # Pillow's Windows wheel needs fribidi.dll for raqm text shaping (emoji sequences) binaries = [] if sys.platform == "win32": binaries.append((str(ROOT / "assets" / "win" / "fribidi.dll"), ".")) a = Analysis( [str(ROOT / "label_app.py")], pathex=[str(ROOT)], datas=datas, binaries=binaries, hiddenimports=["serial.tools.list_ports", "PIL.ImageTk", "PIL._tkinter_finder"], excludes=["numpy", "matplotlib", "scipy", "pandas", "IPython"], noarchive=False, ) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, a.binaries, a.datas, [], name="NiimbotLabel", icon=str(ROOT / "assets" / "icon.ico") if sys.platform == "win32" else None, console=False, # GUI app: no console window upx=False, strip=False, onefile=True, )