Files
myGarminApp/packaging/myGarmin.spec
Riaan Doorduin 39ce4e73a0 Windows installer; ship the dashboard template
- packaging/: PyInstaller spec (one folder, windowed, Python included), Inno Setup script
  (per-user install, Start menu, optional desktop icon, WebView2 check), build.ps1, app icon.
- Bundled exe also runs the CLI (output to %LOCALAPPDATA%\myGarmin\cli.log).
- Fix: .gitignore pattern dashboard*.html also hid src/mygarmin/report/dashboard.html, so the
  template was never committed and fresh clones could not build a dashboard. Patterns anchored;
  data file types (*.gpx, *.csv, *.json, *.gz, *.log) ignored too.
- Self-test runs beside an open app (own WebView2 data folder, no single-instance check).
- Neutral example values in a docstring and the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 14:10:05 +02:00

17 lines
1.1 KiB
Python

# PyInstaller spec: one-folder, windowed build of the myGarmin app. Build with packaging\build.ps1.
from PyInstaller.utils.hooks import collect_all, collect_data_files
datas = collect_data_files('mygarmin', includes=['**/*.html'])
datas += collect_data_files('timezonefinder') + collect_data_files('tzdata')
binaries, hidden = [], []
for pkg in ('webview', 'clr_loader', 'pythonnet', 'garminconnect', 'curl_cffi', 'timezonefinder'): # js files, .NET bridge, native libs, tz data (needs numpy)
d, b, h = collect_all(pkg); datas += d; binaries += b; hidden += h
a = Analysis(['launcher.py'], pathex=['../src'], binaries=binaries, datas=datas,
hiddenimports=hidden + ['mygarmin.sources.garmin_api', 'mygarmin.sources.watch', 'mygarmin.cli', 'mygarmin.export', 'mygarmin.report', 'mygarmin.dedupe', 'clr'],
excludes=['tkinter', 'matplotlib', 'pandas', 'PIL', 'pytest'], noarchive=False)
pyz = PYZ(a.pure)
exe = EXE(pyz, a.scripts, [], exclude_binaries=True, name='myGarmin', icon='myGarmin.ico',
console=False, upx=False, version='version_info.txt')
coll = COLLECT(exe, a.binaries, a.datas, name='myGarmin', upx=False)