From ae16c4e52411620972431ec60f8bc3c2c67c2946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 5 Sep 2024 18:37:43 +0200 Subject: [PATCH] Document how to manually update locked package version (#7083) This PR updates documentation to explicitly mention how to update a specific package with a locked version to a different version. Fixes: https://github.com/astral-sh/uv/issues/7019 --------- Co-authored-by: Zanie Blue --- docs/concepts/projects.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/concepts/projects.md b/docs/concepts/projects.md index 263f94382..c20c1eb20 100644 --- a/docs/concepts/projects.md +++ b/docs/concepts/projects.md @@ -364,8 +364,30 @@ up-to-date, an error will be raised instead of updating the lockfile. By default, uv will prefer the locked versions of packages when running `uv sync` and `uv lock`. Package versions will only change if the project's dependency constraints exclude the previous, -locked version. To upgrade to the latest package versions supported by the project's dependency -constraints, use `uv lock --upgrade`. +locked version. + +To upgrade all packages: + +```console +$ uv lock --upgrade +``` + +To upgrade a single package to the latest version: + +```console +$ uv lock --upgrade-package +``` + +To upgrade a single package to a specific version: + +```console +$ uv lock --upgrade-package == +``` + +!!! note + + In all cases, upgrades are limited to the project's dependency constraints. For example, if the + project defines an upper bound for a package then an upgrade will not go beyond that version. ### Limited resolution environments