mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-29 11:07:59 +00:00
Update validation for enviroments and required-environments in uv.toml (#14905)
See https://github.com/astral-sh/uv/pull/14322/files#r2231891679 Closes https://github.com/astral-sh/uv/issues/14904
This commit is contained in:
parent
a701d3c447
commit
c489fcb633
2 changed files with 17 additions and 12 deletions
|
|
@ -211,8 +211,8 @@ fn validate_uv_toml(path: &Path, options: &Options) -> Result<(), Error> {
|
|||
override_dependencies: _,
|
||||
constraint_dependencies: _,
|
||||
build_constraint_dependencies: _,
|
||||
environments: _,
|
||||
required_environments: _,
|
||||
environments,
|
||||
required_environments,
|
||||
conflicts,
|
||||
workspace,
|
||||
sources,
|
||||
|
|
@ -265,6 +265,19 @@ fn validate_uv_toml(path: &Path, options: &Options) -> Result<(), Error> {
|
|||
"build-backend",
|
||||
));
|
||||
}
|
||||
if environments.is_some() {
|
||||
return Err(Error::PyprojectOnlyField(
|
||||
path.to_path_buf(),
|
||||
"environments",
|
||||
));
|
||||
}
|
||||
|
||||
if required_environments.is_some() {
|
||||
return Err(Error::PyprojectOnlyField(
|
||||
path.to_path_buf(),
|
||||
"required-environments",
|
||||
));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -336,8 +349,8 @@ fn warn_uv_toml_masked_fields(options: &Options) {
|
|||
override_dependencies,
|
||||
constraint_dependencies,
|
||||
build_constraint_dependencies,
|
||||
environments,
|
||||
required_environments,
|
||||
environments: _,
|
||||
required_environments: _,
|
||||
conflicts: _,
|
||||
workspace: _,
|
||||
sources: _,
|
||||
|
|
@ -504,12 +517,6 @@ fn warn_uv_toml_masked_fields(options: &Options) {
|
|||
if build_constraint_dependencies.is_some() {
|
||||
masked_fields.push("build-constraint-dependencies");
|
||||
}
|
||||
if environments.is_some() {
|
||||
masked_fields.push("environments");
|
||||
}
|
||||
if required_environments.is_some() {
|
||||
masked_fields.push("required-environments");
|
||||
}
|
||||
if !masked_fields.is_empty() {
|
||||
let field_listing = masked_fields.join("\n- ");
|
||||
warn_user!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue