Make uv.sources without --preview non-fatal (#4558)

## Summary

Like other preview usages, this should just warn.
This commit is contained in:
Charlie Marsh 2024-06-26 14:07:00 -04:00 committed by GitHub
parent 45c271d15d
commit d4fd868531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 37 additions and 38 deletions

View file

@ -40,8 +40,6 @@ pub enum LoweringError {
ForbiddenFragment(Url),
#[error("`workspace = false` is not yet supported")]
WorkspaceFalse,
#[error("`tool.uv.sources` is a preview feature; use `--preview` or set `UV_PREVIEW=1` to enable it")]
MissingPreview,
#[error("Editable must refer to a local directory, not a file: `{0}`")]
EditableFile(String),
#[error(transparent)] // Function attaches the context
@ -95,7 +93,7 @@ pub(crate) fn lower_requirement(
};
if preview.is_disabled() {
return Err(LoweringError::MissingPreview);
warn_user_once!("`uv.sources` is experimental and may change without warning.");
}
let source = match source {