mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-30 11:37:24 +00:00
Reject pyproject.toml in --config-file (#5842)
This already rejects `pyproject.toml`... but because the schema validation is relaxed (we allow unknown fields, and all fields are optional), a `pyproject.toml` doesn't get properly rejected here. This PR makes the schema stricter, but in a safe way (by adding the other `tool.uv` fields, like `workspace`, as any). Closes #5832.
This commit is contained in:
parent
fae9a70ca0
commit
9b06b3905d
6 changed files with 266 additions and 1 deletions
|
|
@ -76,10 +76,14 @@ pub struct Tool {
|
|||
pub uv: Option<ToolUv>,
|
||||
}
|
||||
|
||||
// NOTE(charlie): When adding fields to this struct, mark them as ignored on `Options` in
|
||||
// `crates/uv-settings/src/settings.rs`.
|
||||
#[derive(Serialize, Deserialize, OptionsMetadata, Debug, Clone, PartialEq, Eq)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct ToolUv {
|
||||
/// The sources to use (e.g., workspace members, Git repositories, local paths) when resolving
|
||||
/// dependencies.
|
||||
pub sources: Option<BTreeMap<PackageName, Source>>,
|
||||
/// The workspace definition for the project, if any.
|
||||
#[option_group]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue