Skip to content

Conversation

@terror
Copy link
Contributor

@terror terror commented Nov 10, 2025

Initial work for #16653

This PR adds a lightweight install summary to uv sync --output-format json by threading the changelog returned from the pip operations into the sync report: the JSON now includes a sync.packages array detailing each added, removed, or reinstalled distribution (with version and optional source URL), so users can inspect the plan without parsing stderr.

As stated in #16653, this is a preview change. We'll likely need to iterate on this in a few other changes (or keep adding onto this one).

Some ideas:

  • Wire this up with --dry-run
  • Richer context (dependency group, editable/file path, source index, etc)

#[derive(Serialize, Debug, Clone)]
struct PackageChangeReport {
/// The normalized package name.
name: String,
Copy link
Member

Choose a reason for hiding this comment

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

PackageName supports serialization, no? We shouldn't resolve to strings here unless we need to.

action: SyncAction,
/// The packages that changed during the sync.
#[serde(default)]
packages: Vec<PackageChangeReport>,
Copy link
Member

Choose a reason for hiding this comment

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

After looking at it... I wonder if we should call it changes? I worry packages could be confusing because it doesn't imply it's only the packages that changed

Copy link
Member

Choose a reason for hiding this comment

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

Unless we also want to enumerate all the packages that are unchanged here, with action: check... hm.

@zanieb
Copy link
Member

zanieb commented Nov 10, 2025

What's your plan for dry-run? I think a clear path forward there is important to understand, even if we don't implement it here.

@zanieb zanieb added the preview Experimental behavior label Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants