Add GUI extra in auto-updater; support uv (#3346)
* Support multiple update backends
Add utilities to construct package specs and installer commands (supporting uv then pip) and import shutil/sys. Update MainWindow to run update commands in sequence: store a queue of backends, start each with _start_next_update_command, accumulate attempt outputs and backend names, and retry fallbacks when one backend fails. Improve error messages and logging, adjust progress/cleanup behavior, and surface a consolidated failure dialog if no backend succeeds.
* Add tests for auto-update GUI utils
Add unit tests for deeplabcut.gui.utils functions package_specs_for_update and build_update_commands. Tests verify package_specs_for_update adds the GUI extra to 'deeplabcut', preserves other packages, and strips surrounding whitespace. Tests for build_update_commands assert backend ordering and that 'uv' is used when available, the exact command arguments (including use of sys.executable), and that a pip fallback is always present; monkeypatching of shutil.which is used to simulate installer availability.
* Reset update output and skip test if no PySide6
Initialize _update_process_output to an empty list when tearing down the update process to avoid carrying over stale output after process deletion. Also make the GUI auto-update test skip when PySide6 is not installed by adding pytest.importorskip("PySide6") to tests/gui/test_auto_update.py, preventing failures in environments without the GUI dependency.
* Remove duplicate test
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Guard and disconnect update process signals
Add robust handling for the update QProcess to avoid races and leaks. Introduces _disconnect_update_process to safely disconnect signals, updates _drain_update_process_output to accept a process (and resolve sender()), and adds sender checks in error/finished handlers so only the current process is handled. Ensures signals are disconnected before deleteLater and prevents acting on stale or unrelated processes.
* Separate failed output for update retries
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Update window.py
* Make update helpers private and tighten process handling
Rename public update helper functions to private (_package_specs_for_update, _build_update_commands) to indicate internal API and update all imports/usages in deeplabcut/gui/window.py and tests. Adjust MainWindow process handling: add None checks when comparing sender/process, call deleteLater() on the local process variable, and remove a redundant progress_bar.hide() on successful update. Update tests to reference the new private function names.
* Update window.py
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> C
Cyril Achard committed
a7cc95c2de3b71e293740bc686de27e509cd4682
Parent: ef2acdb
Committed by GitHub <noreply@github.com>
on 6/27/2026, 8:18:45 AM