Add JSON Output for uv sync --dry-run#12405
Closed
x0rw wants to merge 9 commits intoastral-sh:mainfrom
Closed
Conversation
Contributor
Author
|
I can't fix the failling test for windows atm, the issue arises from filtering directories on windows in the test( |
…ultiple resources, update comments
Contributor
Author
|
Hey @zanieb , this PR is almost complete, with just a small part left to finish. Could you please review it? If a rebase is needed, let me know. |
Contributor
|
I've rebased and continued this impl over here: |
zanieb
added a commit
that referenced
this pull request
Jul 14, 2025
This is a continuation of the work in * #12405 I have: * moved to an architecture where the human output is derived from the json structs to centralize more of the printing state/logic * cleaned up some of the names/types * added tests * removed the restriction that this output is --dry-run only I have not yet added package info, which was TBD in their design. --------- Co-authored-by: x0rw <[email protected]> Co-authored-by: Zanie Blue <[email protected]> Co-authored-by: John Mumm <[email protected]>
Member
|
Added in #13689 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UPDATE:
Summary
This PR adds support for the --format=json flag to the uv sync --dry-run command. When enabled, the command outputs details in JSON format, making it easier to parse and integrate with other tools.
the dry run output json includes:
The Json output is currently pretty-printed for readability.
Test Plan
Manual testing has been performed to verify JSON output.
--script
cargo run sync --dry-run --script foo.py --format=jsonoutput:
--project
cargo run sync --dry-run --project test_dir --format=jsonoutput:
Note:
2>/dev/nullcan be appended to the end of the command to redirect stderr away and show only the stdout(which contains the json only).Related Issue
Resolves #12387.