88 lines
3.2 KiB
RPMSpec
88 lines
3.2 KiB
RPMSpec
# lottosight.spec
|
|
# ----------------
|
|
# PyInstaller spec for LottoSight (Windows directory build).
|
|
# Build: pyinstaller lottosight.spec
|
|
# Output: dist/LottoSight/LottoSight.exe (+ supporting files)
|
|
#
|
|
# User-writable data (DB, exports) is stored next to the .exe at runtime.
|
|
# Read-only assets (icon) are bundled inside the package via datas.
|
|
|
|
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
|
|
|
|
# ── Data files ────────────────────────────────────────────────────────────────
|
|
datas = [
|
|
# Bundle the assets folder (icon.png) into the package root
|
|
('assets', 'assets'),
|
|
]
|
|
# Matplotlib ships its own data directory (fonts, colormaps, style sheets)
|
|
datas += collect_data_files('matplotlib')
|
|
# openpyxl ships its own templates
|
|
datas += collect_data_files('openpyxl')
|
|
|
|
# ── Hidden imports ────────────────────────────────────────────────────────────
|
|
hiddenimports = [
|
|
# Matplotlib TkAgg backend — not detected by static analysis
|
|
'matplotlib.backends.backend_tkagg',
|
|
# APScheduler components loaded via entry-point discovery at runtime
|
|
'apscheduler.schedulers.background',
|
|
'apscheduler.executors.pool',
|
|
'apscheduler.jobstores.memory',
|
|
'apscheduler.triggers.interval',
|
|
'apscheduler.triggers.date',
|
|
# truststore — Windows native certificate store injection
|
|
'truststore',
|
|
# Tkinter sub-modules
|
|
'tkinter',
|
|
'tkinter.ttk',
|
|
'tkinter.filedialog',
|
|
'tkinter.messagebox',
|
|
]
|
|
|
|
# ── Analysis ──────────────────────────────────────────────────────────────────
|
|
a = Analysis(
|
|
['main.py'],
|
|
pathex=[],
|
|
binaries=[],
|
|
datas=datas,
|
|
hiddenimports=hiddenimports,
|
|
hookspath=[],
|
|
hooksconfig={},
|
|
runtime_hooks=[],
|
|
# Strip test / notebook dependencies to keep the bundle smaller
|
|
excludes=['pytest', 'IPython', 'ipykernel', 'jupyter'],
|
|
noarchive=False,
|
|
optimize=0,
|
|
)
|
|
|
|
pyz = PYZ(a.pure)
|
|
|
|
# ── Executable ────────────────────────────────────────────────────────────────
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
[],
|
|
exclude_binaries=True, # binaries go into COLLECT, not baked into exe
|
|
name='LottoSight',
|
|
debug=False,
|
|
bootloader_ignore_signals=False,
|
|
strip=False,
|
|
upx=True,
|
|
console=False, # no console window (pure GUI app)
|
|
argv_emulation=False,
|
|
target_arch=None,
|
|
codesign_identity=None,
|
|
entitlements_file=None,
|
|
)
|
|
|
|
# ── Directory bundle ──────────────────────────────────────────────────────────
|
|
coll = COLLECT(
|
|
exe,
|
|
a.binaries,
|
|
a.zipfiles,
|
|
a.datas,
|
|
strip=False,
|
|
upx=True,
|
|
upx_exclude=[],
|
|
name='LottoSight', # output: dist/LottoSight/
|
|
)
|