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>
This commit is contained in:
2026-10-17 14:10:05 +02:00
parent 7b1276f0b1
commit 39ce4e73a0
12 changed files with 692 additions and 10 deletions

View File

@@ -47,7 +47,7 @@ def inbox(tmp_path):
buf = io.StringIO(); csv.writer(buf).writerows(rows)
(st / 'activities.csv').write_text(buf.getvalue() + '\x00' * 20) # Strava pads its files with NULs
# Garmin Connect export, zipped, with two days of health data
days = [{'calendarDate': f'2024-03-0{i}', 'restingHeartRate': 50 + i, 'totalSteps': 9000, 'bodyBattery': {'bodyBatteryStatList': [
days = [{'calendarDate': f'2024-03-0{i}', 'restingHeartRate': 60 + i, 'totalSteps': 9000, 'bodyBattery': {'bodyBatteryStatList': [
{'bodyBatteryStatType': 'HIGHEST', 'statsValue': 90}, {'bodyBatteryStatType': 'LOWEST', 'statsValue': 20}]}} for i in (2, 3)]
sleep = [{'calendarDate': '2024-03-03', 'sleepStartTimestampGMT': '2024-03-02T20:30:00.0', 'sleepEndTimestampGMT': '2024-03-03T04:45:00.0',
'deepSleepSeconds': 4000, 'lightSleepSeconds': 16000, 'remSleepSeconds': 6000, 'awakeSleepSeconds': 600, 'sleepScores': {'overallScore': 81}}]
@@ -70,7 +70,7 @@ def test_pipeline(tmp_path, inbox):
assert a['car.trk']['flag'] == 'transport'
assert a['2.gpx']['dup_of'] is None and a['2.gpx']['name'] == 'Morning Ride'
days = {d['d']: d for d in lib.days()}
assert days['2024-03-03']['rhr'] == 53 and days['2024-03-03']['sleep'] == round(26000 / 3600, 2)
assert days['2024-03-03']['rhr'] == 63 and days['2024-03-03']['sleep'] == round(26000 / 3600, 2)
assert days['2024-03-03']['bed'] == -1.5 # 22:30 local
assert lib.series('bp')[0]['hb'] == 14.6
out = report.build(lib, log=lambda *_: None)