You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`SPECTROview` ships a lightweight, opt-out update notification system that queries the GitHub Releases API in the background and displays a dismissable banner when a newer version is found.
373
+
`SPECTROview` ships a lightweight, opt-out update system that queries the GitHub Releases API in the background and displays a dismissable banner when a newer version is found. The banner can download the wheel attached to that exact release, verify its GitHub SHA-256 digest when available, close the application, install the wheel with pip, and relaunch it.
374
374
375
375
No extra dependency is required — only Python's built-in `urllib`.
376
376
377
377
### Key Files
378
378
379
379
| File | Role |
380
380
|------|------|
381
-
|`model/m_update_checker.py`|`QThread`worker — performs the HTTP request and emits `update_available`|
381
+
|`model/m_update_checker.py`|`QThread`workers for release checks and wheel downloads; creates the detached pip-install/restart helper|
382
382
|`view/components/v_update_banner.py`| Slim 36 px banner widget inserted at position 0 of the central layout |
383
383
|`model/m_settings.py`| Stores `enabled`, `skipped_version`, and `last_check_date` in `QSettings`|
384
384
|`main.py`| Starts the thread via `QTimer.singleShot(2000, ...)` from `showEvent`|
|**`QThread` instead of `QNetworkAccessManager`**| Pure Python `urllib` avoids Qt networking module complexity; thread is simpler to test |
413
421
|**2-second startup delay**| Ensures the UI is fully painted before the network request starts |
414
422
|**Once-per-day throttle**| Avoids redundant requests; the date is persisted via `QSettings`|
415
-
|**Silent failure**|`URLError`, `OSError`, `json.JSONDecodeError` are all caught — offline machines see no error |
423
+
|**Silent check failure**|`URLError`, `OSError`, `json.JSONDecodeError` are caught — offline machines see no error |
416
424
|**Version comparison via tuples**|`_parse_version('v26.29.0') → (26, 29, 0)` handles `v`-prefixed tags and non-numeric parts gracefully |
425
+
|**Release asset source**| GitHub provides the version, release notes, wheel URL, and integrity digest in one public API response; PyPI remains the normal package-install channel |
426
+
|**Detached helper**| The helper waits for Qt to exit, installs with the launching interpreter, then clears `PYTHONPATH`/`PYTHONHOME` and restarts from a temporary working directory so a checkout cannot shadow the freshly installed package |
417
427
|**Skip vs Dismiss**|*Skip* persists the exact tag — the banner re-appears for the next release. *Dismiss* hides only for the session |
418
428
419
429
### Adding / Modifying the Checker
420
430
421
-
To change the API endpoint (e.g., to query PyPI instead), edit `GITHUB_API_URL` in `m_update_checker.py` and adjust the JSON key extraction in `UpdateCheckerWorker.run()`.
431
+
Release automation lives in `.github/workflows/release.yml`. Pushing a `vMAJOR.MINOR.PATCH` tag whose value matches `spectroview.VERSION` builds the wheel and source distribution, attaches them to a GitHub release, and publishes them to PyPI through the `pypi` environment's Trusted Publisher.
432
+
433
+
Before the first automated PyPI publication, register a Trusted Publisher for
434
+
`CEA-MetroCarac/SPECTROview` in the PyPI project's **Publishing** settings with
435
+
workflow filename `release.yml` and environment `pypi`. This lets GitHub Actions
436
+
obtain a short-lived publishing token without storing a long-lived PyPI API token
437
+
in the repository.
422
438
423
439
To add a "disable updates" toggle to the Settings dialog, bind `MSettings.set_check_for_updates()` to a `QCheckBox` in `v_settings.py` — the `_start_update_check()` method in `main.py` already reads this flag before starting the thread.
0 commit comments