Visitar URL original
fix(uv): uv lock --upgrade ignored when upgrade-package set in config (#19954) by beast-ofcourse · Pull Request #20168 · astral-sh/uv · GitHub
Skip to content

fix(uv): uv lock --upgrade ignored when upgrade-package set in config (#19954) - #20168

Closed
beast-ofcourse wants to merge 1 commit into
astral-sh:mainfrom
beast-ofcourse:fix/upgrade-strategy-combine
Closed

beast-ofcourse wants to merge 1 commit into
astral-sh:mainfrom
beast-ofcourse:fix/upgrade-strategy-combine

Conversation

@beast-ofcourse

Copy link
Copy Markdown

Summary

uv lock --upgrade was being ignored when upgrade-package was set in pyproject.toml via [tool.uv].

Root Cause

In Upgrade::combine(), the match arms checked (_, UpgradeStrategy::All) first, which meant the config file's UpgradeStrategy::All (set when upgrade-package is configured) would take precedence over the CLI's UpgradeStrategy::All (set by --upgrade). Since match arms are evaluated top-to-bottom, (UpgradeStrategy::All, _) needed to come first.

Changes

  • crates/uv-configuration/src/package_options.rs: Add (UpgradeStrategy::All, _) => UpgradeStrategy::All as the first arm in Upgrade::combine()

Closes #19954

…ade::combine (#19954)

Add (UpgradeStrategy::All, _) => UpgradeStrategy::All as the first arm
in Upgrade::combine() so that --upgrade from the CLI takes precedence
over upgrade-package set in pyproject.toml. Previously the config value
(UpgradeStrategy::Some) would override the CLI flag.

Closes #19954
@zanieb

zanieb commented Jul 7, 2026

Copy link
Copy Markdown
Member

This is a duplicate of #19955

@zanieb zanieb closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv lock --upgrade does not work if upgrade-package is set in pyproject.toml

2 participants