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 <contact@zanie.dev>
This commit is contained in:
Jakub Beránek 2024-09-05 18:37:43 +02:00 committed by GitHub
parent d470dfce8e
commit ae16c4e524
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 2 deletions

View File

@ -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`. 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, 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 locked version.
constraints, use `uv lock --upgrade`.
To upgrade all packages:
```console
$ uv lock --upgrade
```
To upgrade a single package to the latest version:
```console
$ uv lock --upgrade-package <package>
```
To upgrade a single package to a specific version:
```console
$ uv lock --upgrade-package <package>==<version>
```
!!! 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 ### Limited resolution environments