Repository navigation
Conversation
| .filter(move |item| { | ||
| matches!(item.kind(), ConflictKind::Extra(_)) | ||
| && set.contains(item.package(), ConflictKindRef::Project) |
There was a problem hiding this comment.
[P3] Centralize the own-project/extra conflict relationship
This duplicates the relationship already computed by the project_conflicts_with_extra closure and method in crates/uv-lock/src/lock/mod.rs. The same exception now controls resolver fork pruning and lockfile dependency validation, leaving three definitions that maintainers must keep synchronized. Move this domain query onto Conflicts and reuse it in both layers; the resolver can continue caching the resulting extras for fork checks.
| /// Dependency groups can be selected without their project's production dependencies. | ||
| #[test] | ||
| fn project_level_conflict_with_own_group() -> Result<()> { | ||
| let context = uv_test::test_context!("3.12"); | ||
| let scenario = toml::from_str::<Scenario>(indoc! {r#" |
There was a problem hiding this comment.
[P3] Remove the duplicate project/group conflict scenario
This standalone scenario duplicates lock_conflicting_project_basic1 in crates/uv/tests/lock/lock.rs, which already checks incompatible production/group requirements, successful locking with a declared conflict, and separate production and --only-group selections. The new project_level_conflict_with_extra_and_group_forks test also covers group independence alongside the changed extra-pruning behavior. Remove this standalone test to avoid maintaining another fixture and command snapshots for behavior already covered.
Merging this PR will not alter performance
|
Overlapping project and extra entries in
tool.uv.conflictscan keep an extra active after excluding its project, pulling that project's dependencies into an impossible fork and rejecting a satisfiable resolution. Reject those forks while respecting conflicts that explicitly make a project's extra an alternative to its production selection. Dependency groups can still be selected independently of production dependencies.