mirror of https://github.com/astral-sh/uv
Error on unknown dependency object specifiers (#12841)
This reverts commit dd788a0f47.
And relands #12811, for 0.7.0
This commit is contained in:
parent
990c59ddb6
commit
318949ade6
|
|
@ -3,7 +3,7 @@ use std::collections::BTreeMap;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tracing::warn;
|
use tracing::error;
|
||||||
|
|
||||||
use uv_normalize::{GroupName, DEV_DEPENDENCIES};
|
use uv_normalize::{GroupName, DEV_DEPENDENCIES};
|
||||||
use uv_pep508::Pep508Error;
|
use uv_pep508::Pep508Error;
|
||||||
|
|
@ -74,9 +74,10 @@ impl FlatDependencyGroups {
|
||||||
.extend(resolved.get(include_group).into_iter().flatten().cloned());
|
.extend(resolved.get(include_group).into_iter().flatten().cloned());
|
||||||
}
|
}
|
||||||
DependencyGroupSpecifier::Object(map) => {
|
DependencyGroupSpecifier::Object(map) => {
|
||||||
warn!(
|
return Err(DependencyGroupError::DependencyObjectSpecifierNotSupported(
|
||||||
"Ignoring Dependency Object Specifier referenced by `{name}`: {map:?}"
|
name.clone(),
|
||||||
);
|
map.clone(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -154,6 +155,8 @@ pub enum DependencyGroupError {
|
||||||
DevGroupInclude(GroupName),
|
DevGroupInclude(GroupName),
|
||||||
#[error("Detected a cycle in `dependency-groups`: {0}")]
|
#[error("Detected a cycle in `dependency-groups`: {0}")]
|
||||||
DependencyGroupCycle(Cycle),
|
DependencyGroupCycle(Cycle),
|
||||||
|
#[error("Group `{0}` contains an unknown dependency object specifier: {1:?}")]
|
||||||
|
DependencyObjectSpecifierNotSupported(GroupName, BTreeMap<String, String>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DependencyGroupError {
|
impl DependencyGroupError {
|
||||||
|
|
|
||||||
|
|
@ -20833,14 +20833,15 @@ fn lock_group_invalid_entry_table() -> Result<()> {
|
||||||
"#,
|
"#,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
uv_snapshot!(context.filters(), context.lock(), @r###"
|
uv_snapshot!(context.filters(), context.lock(), @r#"
|
||||||
success: true
|
success: false
|
||||||
exit_code: 0
|
exit_code: 1
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
||||||
----- stderr -----
|
----- stderr -----
|
||||||
Resolved 2 packages in [TIME]
|
× Failed to build `project @ file://[TEMP_DIR]/`
|
||||||
"###);
|
╰─▶ Group `foo` contains an unknown dependency object specifier: {"bar": "unknown"}
|
||||||
|
"#);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue