Skip to content

Preserve attribution in inverted dependency trees - #19899

Closed
zanieb wants to merge 2 commits into
astral-sh:charlie/fix-synthetic-tree-rootsfrom
zanieb:zb/tree-invert-attribution
Closed

Preserve attribution in inverted dependency trees#19899
zanieb wants to merge 2 commits into
astral-sh:charlie/fix-synthetic-tree-rootsfrom
zanieb:zb/tree-invert-attribution

Conversation

@zanieb

@zanieb zanieb commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

Preserve dependency provenance when rendering inverted project trees.

Inverted traversal now carries required extras and universal marker conditions through each reverse path, stops dependency-group paths at the workspace member that owns the group, and rejects consumers that did not activate the required extra. Declared conflict constraints are included when checking marker satisfiability, so mutually exclusive extras and groups cannot form an impossible path through a shared package node.

This prevents uv tree --invert from attributing an optional, grouped, or marker-conditional dependency to unrelated workspace members.

Test Plan

  • cargo +stable test --package uv --test project tree
  • cargo +stable clippy --package uv-resolver --all-targets --all-features --locked -- -D warnings
  • cargo +stable clippy --package uv --test project --locked -- -D warnings
  • cargo +stable fmt --all -- --check
  • git diff --check

@astral-sh-bot

astral-sh-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the latest main baseline.

  • Added tests: 5
  • Removed tests: 0
  • Changed suites: 1
uv::project: +5 / -0

Added:

  • uv::project::tree::invert_preserves_conflict_marker_attribution
  • uv::project::tree::invert_preserves_dependency_group_attribution
  • uv::project::tree::invert_preserves_extra_attribution
  • uv::project::tree::invert_preserves_marker_attribution
  • uv::project::tree::non_project_group_selection_with_extras

Removed: none

@zanieb

zanieb commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

Rebased onto #19905

@zanieb
zanieb force-pushed the zb/tree-invert-attribution branch from fbc5775 to 272fe24 Compare June 18, 2026 03:51

@charliermarsh charliermarsh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this should merge.

@charliermarsh

Copy link
Copy Markdown
Member

Oh sorry missed your comment!

@zanieb
zanieb changed the base branch from main to charlie/fix-synthetic-tree-roots June 18, 2026 13:20
@zanieb
zanieb deleted the branch astral-sh:charlie/fix-synthetic-tree-roots June 18, 2026 13:31
@zanieb zanieb closed this Jun 18, 2026
zanieb added a commit that referenced this pull request Jun 18, 2026
Replacement for #19899, which GitHub closed automatically when its
stacked base was merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants