diff --git a/crates/uv-settings/src/settings.rs b/crates/uv-settings/src/settings.rs index 254cb204b..dbd5fd324 100644 --- a/crates/uv-settings/src/settings.rs +++ b/crates/uv-settings/src/settings.rs @@ -517,8 +517,10 @@ pub struct ResolverInstallerOptions { /// - `prefer-locked`: Prefer the versions pinned in the lockfile, if available. /// /// When set to `prefer-locked`, uv will use the locked versions of packages specified in the - /// lockfile as preferences when resolving build dependencies during source builds. This helps - /// ensure that build environments are consistent with the project's resolved dependencies. + /// lockfile as preferences when resolving build dependencies during source builds, such that + /// the locked version of a package will be used as long as it doesn't conflict with version + /// constraints declared by the package being built. This helps ensure that build environments + /// are consistent with the project's resolved dependencies. #[option( default = "\"latest\"", value_type = "str", diff --git a/docs/reference/settings.md b/docs/reference/settings.md index 31dd1157b..7fed1b2b6 100644 --- a/docs/reference/settings.md +++ b/docs/reference/settings.md @@ -757,8 +757,10 @@ The strategy to use when resolving build dependencies for source distributions. - `prefer-locked`: Prefer the versions pinned in the lockfile, if available. When set to `prefer-locked`, uv will use the locked versions of packages specified in the -lockfile as preferences when resolving build dependencies during source builds. This helps -ensure that build environments are consistent with the project's resolved dependencies. +lockfile as preferences when resolving build dependencies during source builds, such that +the locked version of a package will be used as long as it doesn't conflict with version +constraints declared by the package being built. This helps ensure that build environments +are consistent with the project's resolved dependencies. **Default value**: `"latest"` diff --git a/uv.schema.json b/uv.schema.json index d592eca73..fce59304e 100644 --- a/uv.schema.json +++ b/uv.schema.json @@ -47,7 +47,7 @@ } }, "build-dependency-strategy": { - "description": "The strategy to use when resolving build dependencies for source distributions.\n\n- `latest`: Use the latest compatible version of each build dependency.\n- `prefer-locked`: Prefer the versions pinned in the lockfile, if available.\n\nWhen set to `prefer-locked`, uv will use the locked versions of packages specified in the\nlockfile as preferences when resolving build dependencies during source builds. This helps\nensure that build environments are consistent with the project's resolved dependencies.", + "description": "The strategy to use when resolving build dependencies for source distributions.\n\n- `latest`: Use the latest compatible version of each build dependency.\n- `prefer-locked`: Prefer the versions pinned in the lockfile, if available.\n\nWhen set to `prefer-locked`, uv will use the locked versions of packages specified in the\nlockfile as preferences when resolving build dependencies during source builds, such that\nthe locked version of a package will be used as long as it doesn't conflict with version\nconstraints declared by the package being built. This helps ensure that build environments\nare consistent with the project's resolved dependencies.", "anyOf": [ { "$ref": "#/definitions/BuildDependencyStrategy"