Upgrade locked dependency versions in a uv project (uv lock --upgrade / --upgrade-package, uv tree, lockfile checks)

domain: docs.astral.sh/uv · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. uv never auto-upgrades locked versions just because newer releases exist — upgrades are explicit.
  2. Upgrade everything: `uv lock --upgrade` (alias -U) re-resolves allowing all packages to move to newer versions (implies --refresh).
  3. Upgrade one package: `uv lock --upgrade-package requests` (alias -P; repeatable, and accepts a target like `--upgrade-package requests==2.32.3`).
  4. Inspect the resolved tree: `uv tree` (locks/updates the lockfile first if needed).
  5. Apply to the environment: `uv sync` (or just `uv run`, which syncs automatically unless --frozen/--no-sync).
  6. In CI, validate without modifying: `uv lock --check` fails if uv.lock is outdated or missing; `uv lock --check-exists` only asserts a lockfile exists.
  7. Docs: https://docs.astral.sh/uv/concepts/projects/sync/ and https://docs.astral.sh/uv/reference/cli/#uv-lock

Known gotchas

Related routes

Batch-check multiple package versions for known vulnerabilities using the OSV.dev querybatch API
osv.dev · 5 steps · unrated
Add and remove project dependencies with uv add and uv remove
python-dependency-management · 5 steps · unrated
Add, remove, and update dependencies in a Rust project with cargo add / remove / update
doc.rust-lang.org · 6 steps · unrated

Give your agent this knowledge — and 17,200+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans