Add Git SHA locking behavior to docs (#11125)

## Summary

Closes https://github.com/astral-sh/uv/issues/11090.
This commit is contained in:
Charlie Marsh 2025-01-31 13:11:04 -05:00 committed by GitHub
parent 47f80a62c4
commit 1fae8dbf17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 5 deletions

View File

@ -37,9 +37,9 @@ This is equivalent to the `--locked` flag for other commands.
### Upgrading locked package versions ### Upgrading locked package versions
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` with
Package versions will only change if the project's dependency constraints exclude the previous, an existing `uv.lock` file. Package versions will only change if the project's dependency
locked version. constraints exclude the previous, locked version.
To upgrade all packages: To upgrade all packages:
@ -60,7 +60,12 @@ To upgrade a single package to a specific version:
$ uv lock --upgrade-package <package>==<version> $ uv lock --upgrade-package <package>==<version>
``` ```
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.
!!! note !!! note
In all cases, upgrades are limited to the project's dependency constraints. For example, if the uv applies similar logic to Git dependencies. For example, if a Git dependency references
project defines an upper bound for a package then an upgrade will not go beyond that version. the `main` branch, uv will prefer the locked commit SHA in an existing `uv.lock` file over
the latest commit on the `main` branch, unless the `--upgrade` or `--upgrade-package` flags
are used.