-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add JSON Output for uv sync --dry-run #12405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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
|
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. |
|
I've rebased and continued this impl over here: |
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]>
|
Added in #13689 |
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.