Error on unknown dependency object specifiers (#12841)

This reverts commit dd788a0f47.

And relands #12811, for 0.7.0
This commit is contained in:
Aria Desires 2025-04-11 15:52:00 -04:00 committed by Zanie Blue
parent 990c59ddb6
commit 318949ade6
2 changed files with 13 additions and 9 deletions

View file

@ -3,7 +3,7 @@ use std::collections::BTreeMap;
use std::str::FromStr;
use thiserror::Error;
use tracing::warn;
use tracing::error;
use uv_normalize::{GroupName, DEV_DEPENDENCIES};
use uv_pep508::Pep508Error;
@ -74,9 +74,10 @@ impl FlatDependencyGroups {
.extend(resolved.get(include_group).into_iter().flatten().cloned());
}
DependencyGroupSpecifier::Object(map) => {
warn!(
"Ignoring Dependency Object Specifier referenced by `{name}`: {map:?}"
);
return Err(DependencyGroupError::DependencyObjectSpecifierNotSupported(
name.clone(),
map.clone(),
));
}
}
}
@ -154,6 +155,8 @@ pub enum DependencyGroupError {
DevGroupInclude(GroupName),
#[error("Detected a cycle in `dependency-groups`: {0}")]
DependencyGroupCycle(Cycle),
#[error("Group `{0}` contains an unknown dependency object specifier: {1:?}")]
DependencyObjectSpecifierNotSupported(GroupName, BTreeMap<String, String>),
}
impl DependencyGroupError {