Skip to content

Commit 52870c5

Browse files
authored
Fix incorrect error message when specifying tool.uv.sources.(package).workspace with other options (#11013)
## Summary When a `pyproject.toml` `[tool.uv.sources.(package)]` section specifies `workspace` and one or more of (`index`, `git`, `url`, `path`, `rev`, `tag`, `branch`, `editable`), running `uv` to build or sync the package gives the error: ``` cannot specify both `index` and `(parameter name)` ``` The error should actually say: ``` cannot specify both `workspace` and `(parameter name)` ``` ## Test Plan I ran `cargo test`, and all tests still passed.
1 parent a2db48d commit 52870c5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

crates/uv-workspace/src/pyproject.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,42 +1242,42 @@ impl<'de> Deserialize<'de> for Source {
12421242
if let Some(workspace) = workspace {
12431243
if index.is_some() {
12441244
return Err(serde::de::Error::custom(
1245-
"cannot specify both `index` and `index`",
1245+
"cannot specify both `workspace` and `index`",
12461246
));
12471247
}
12481248
if git.is_some() {
12491249
return Err(serde::de::Error::custom(
1250-
"cannot specify both `index` and `git`",
1250+
"cannot specify both `workspace` and `git`",
12511251
));
12521252
}
12531253
if url.is_some() {
12541254
return Err(serde::de::Error::custom(
1255-
"cannot specify both `index` and `url`",
1255+
"cannot specify both `workspace` and `url`",
12561256
));
12571257
}
12581258
if path.is_some() {
12591259
return Err(serde::de::Error::custom(
1260-
"cannot specify both `index` and `path`",
1260+
"cannot specify both `workspace` and `path`",
12611261
));
12621262
}
12631263
if rev.is_some() {
12641264
return Err(serde::de::Error::custom(
1265-
"cannot specify both `index` and `rev`",
1265+
"cannot specify both `workspace` and `rev`",
12661266
));
12671267
}
12681268
if tag.is_some() {
12691269
return Err(serde::de::Error::custom(
1270-
"cannot specify both `index` and `tag`",
1270+
"cannot specify both `workspace` and `tag`",
12711271
));
12721272
}
12731273
if branch.is_some() {
12741274
return Err(serde::de::Error::custom(
1275-
"cannot specify both `index` and `branch`",
1275+
"cannot specify both `workspace` and `branch`",
12761276
));
12771277
}
12781278
if editable.is_some() {
12791279
return Err(serde::de::Error::custom(
1280-
"cannot specify both `index` and `editable`",
1280+
"cannot specify both `workspace` and `editable`",
12811281
));
12821282
}
12831283

0 commit comments

Comments
 (0)