Skip to content

Fix uv package upgrades in GUI updater - #3535

Merged
deruyter92 merged 1 commit into
devfrom
cy/fix-uv-updater-upgrade-package
Oct 21, 2026
Merged

deruyter92 merged 1 commit into
devfrom
cy/fix-uv-updater-upgrade-package

Conversation

@C-Achard

Copy link
Copy Markdown
Member

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.

Closes #3534.

@C-Achard C-Achard self-assigned this Sep 29, 2026
@C-Achard C-Achard added GUI issues relating to GUI bug fix napari-dlc Related to napari-deeplabcut (labeling workflow, crop, frame extraction...) labels Sep 29, 2026
@C-Achard
C-Achard requested a balanced review from Copilot September 29, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -U flag with targeted --upgrade-package arguments.
  • 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.

@C-Achard
C-Achard requested a review from deruyter92 September 29, 2026 13:10
@C-Achard
C-Achard marked this pull request as ready for review September 29, 2026 13:10
@C-Achard
C-Achard changed the base branch from main to dev September 29, 2026 13:11
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.
@C-Achard
C-Achard force-pushed the cy/fix-uv-updater-upgrade-package branch from 8d0310e to 05b9111 Compare September 29, 2026 13:15

@deruyter92 deruyter92 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@C-Achard C-Achard added the 3.0.3 label Oct 21, 2026
@deruyter92

Copy link
Copy Markdown
Collaborator

I think we should consider adding deeplabcut[gui]== as well, which explicitly brings in the DLC dependency tree.

Nevermind this comment. We agreed that we keep as is, since this would add quite some code with no clear benefits right now.

@deruyter92
deruyter92 merged commit ac40589 into dev Oct 21, 2026
38 checks passed
@deruyter92
deruyter92 deleted the cy/fix-uv-updater-upgrade-package branch October 21, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0.3 bug fix GUI issues relating to GUI napari-dlc Related to napari-deeplabcut (labeling workflow, crop, frame extraction...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GUI auto-update] Updating to napari-deeplabcut v0.4.0 with uv on py3.12+ may pull the wrong numpy version for numba

3 participants