diff --git a/crates/uv-resolver/src/lock/installable.rs b/crates/uv-resolver/src/lock/installable.rs index 97b59f2d0..adcb00ce8 100644 --- a/crates/uv-resolver/src/lock/installable.rs +++ b/crates/uv-resolver/src/lock/installable.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::collections::hash_map::Entry; use std::collections::VecDeque; use std::path::Path; @@ -277,6 +278,14 @@ pub trait Installable<'lock> { Either::Right(package.dependencies.iter()) }; for dep in deps { + let mut activated_extras = Cow::Borrowed(&*activated_extras); + if !dep.extra.is_empty() { + let mut extended = activated_extras.to_vec(); + for extra in &dep.extra { + extended.push((&dep.package_id.name, extra)); + } + activated_extras = Cow::Owned(extended); + } if !dep.complexified_marker.evaluate( marker_env, &activated_extras, diff --git a/crates/uv/tests/it/lock_conflict.rs b/crates/uv/tests/it/lock_conflict.rs index c064d4b3d..e614f8cdf 100644 --- a/crates/uv/tests/it/lock_conflict.rs +++ b/crates/uv/tests/it/lock_conflict.rs @@ -1191,7 +1191,11 @@ fn extra_unconditional_non_conflicting() -> Result<()> { ----- stdout ----- ----- stderr ----- - Audited in [TIME] + Prepared 3 packages in [TIME] + Installed 3 packages in [TIME] + + anyio==4.1.0 + + idna==3.6 + + sniffio==1.3.1 "###); Ok(())