Repository navigation
Fix uv package upgrades in GUI updater - #3535
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation correctly addresses the dependency-upgrade regression with adequate test coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes GUI updates using uv so only requested distributions are upgraded, preventing unrelated dependency upgrades.
Changes:
- Replaces uv’s broad
-Uflag with targeted--upgrade-packagearguments. - Strips extras when deriving distribution names.
- Adds regression coverage for uv command construction and pip fallback.
| File | Description |
|---|---|
deeplabcut/gui/utils.py |
Builds targeted uv upgrade commands while preserving pip fallback. |
tests/gui/test_auto_update.py |
Verifies targeted uv arguments and fallback behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The GUI updater was invoking `uv pip install -U ...`, which can upgrade the wrong packages when requirements include extras. This patch strips extras from package specs and uses `--upgrade-package` with the canonical distribution names, preserving the requested package set while keeping the pip fallback intact. It also adds regression coverage for the uv-only and uv-then-pip command-building paths.
8d0310e to
05b9111
Compare
deruyter92
left a comment
There was a problem hiding this comment.
Agreed, --upgrade-package is the right fix.
I think we should consider adding deeplabcut[gui]==<installed version> as well, which explicitly brings in the DLC dependency tree. This might guard against rare cases where the currently installed dependencies don't satisfy the napari-deeplabcut requirements, but updating might silently break deeplabcut.
Nevermind this comment. We agreed that we keep as is, since this would add quite some code with no clear benefits right now. |
The GUI updater was invoking
uv pip install -U ..., which can upgrade the wrong packages when requirements include extras.This patch strips extras from package specs and uses
--upgrade-packagewith the canonical distribution names, preserving the requested package set while keeping the pip fallback intact.It also adds regression coverage for the uv-only and uv-then-pip command-building paths.
Closes #3534.