diff --git a/docs/concepts/projects.md b/docs/concepts/projects.md index 2bf6f67055f8..fe24109317e0 100644 --- a/docs/concepts/projects.md +++ b/docs/concepts/projects.md @@ -381,7 +381,8 @@ To upgrade all packages: $ uv lock --upgrade ``` -To upgrade a single package to the latest version: +To upgrade a single package to the latest version, while retaining the locked versions of all other +packages: ```console $ uv lock --upgrade-package diff --git a/docs/guides/projects.md b/docs/guides/projects.md index e34806938a91..29b8f94d9c1d 100644 --- a/docs/guides/projects.md +++ b/docs/guides/projects.md @@ -133,6 +133,15 @@ To remove a package, you can use `uv remove`: $ uv remove requests ``` +To upgrade a package, run `uv lock` with the `--upgrade-package` flag: + +```console +$ uv lock --upgrade-package requests +``` + +The `--upgrade-package` flag will attempt to update the specified package to the latest compatible +version, while keeping the rest of the lockfile intact. + See the documentation on [managing dependencies](../concepts/projects.md#managing-dependencies) for more details.