Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions crates/uv-settings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent newline I think?

if required_environments.is_some() {
return Err(Error::PyprojectOnlyField(
path.to_path_buf(),
"required-environments",
));
}
Ok(())
}

Expand Down Expand Up @@ -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: _,
Expand Down Expand Up @@ -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!(
Expand Down
2 changes: 0 additions & 2 deletions crates/uv/tests/it/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14266,8 +14266,6 @@ matplotlib
fn importlib_metadata_not_repeated() -> Result<()> {
let context = TestContext::new("3.12");

let uv_toml = context.temp_dir.child("uv.toml");
uv_toml.write_str(r#"environments = ["python_version >= '3.10'", "python_version >= '3.8' and python_version < '3.10'", "python_version < '3.8'"]"#)?;
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("build")?;

Expand Down
Loading