Note that uv lock --upgrade-package retains locked versions (#7694)

Closes https://github.com/astral-sh/uv/issues/7672.
This commit is contained in:
Charlie Marsh 2024-09-25 18:17:55 -04:00 committed by GitHub
parent cc2aa8855a
commit a3abd89ab0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -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 <package>

View file

@ -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.