Revert "feat: Error on dependency object specifier (#12811)" (#12840)

This reverts commit c117acf905.

This is a minor breaking change, to be relanded in 0.7.0.
This commit is contained in:
Aria Desires 2025-04-11 14:32:48 -04:00 committed by GitHub
parent 50de464425
commit dd788a0f47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 13 deletions

View File

@ -3,7 +3,7 @@ use std::collections::BTreeMap;
use std::str::FromStr;
use thiserror::Error;
use tracing::error;
use tracing::warn;
use uv_normalize::{GroupName, DEV_DEPENDENCIES};
use uv_pep508::Pep508Error;
@ -74,10 +74,9 @@ impl FlatDependencyGroups {
.extend(resolved.get(include_group).into_iter().flatten().cloned());
}
DependencyGroupSpecifier::Object(map) => {
return Err(DependencyGroupError::DependencyObjectSpecifierNotSupported(
name.clone(),
map.clone(),
));
warn!(
"Ignoring Dependency Object Specifier referenced by `{name}`: {map:?}"
);
}
}
}
@ -155,8 +154,6 @@ 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 {

View File

@ -20832,15 +20832,14 @@ fn lock_group_invalid_entry_table() -> Result<()> {
"#,
)?;
uv_snapshot!(context.filters(), context.lock(), @r#"
success: false
exit_code: 1
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
× Failed to build `project @ file://[TEMP_DIR]/`
Group `foo` contains an unknown dependency object specifier: {"bar": "unknown"}
"#);
Resolved 2 packages in [TIME]
"###);
Ok(())
}