From 3ece75fc123088bf7f29ff44a7ae1837271c93e0 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 8 Apr 2025 17:01:12 -0400 Subject: [PATCH] Error when `tool.uv.sources` is set in system-level configuration file (#12757) ## Summary I think the lack of enforcement here is an oversight. We _do_ already enforce this for user-level configuration files (contrary to the issue -- at least, in my testing and from reading the code). Closes https://github.com/astral-sh/uv/issues/12753. --- crates/uv-settings/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/uv-settings/src/lib.rs b/crates/uv-settings/src/lib.rs index d44cf3156..54ae4e261 100644 --- a/crates/uv-settings/src/lib.rs +++ b/crates/uv-settings/src/lib.rs @@ -64,8 +64,11 @@ impl FilesystemOptions { let Some(file) = system_config_file() else { return Ok(None); }; + tracing::debug!("Found system configuration in: `{}`", file.display()); - Ok(Some(Self(read_file(&file)?))) + let options = read_file(&file)?; + validate_uv_toml(&file, &options)?; + Ok(Some(Self(options))) } /// Find the [`FilesystemOptions`] for the given path.