-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Output format json #411
Comments
I'd love it, too :) |
#3199 has relevant context for implementing this in the |
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary I use `uv` for automation on remote hosts and it would be useful to have it be able to tell me the supported versions of python (for the remote machine) in a machine readable manner so I do not need to parse `uv python list`. This change adds `--format (json|text)` to `uv python list` to make it's output machine readable Loosely related: - #411 ## Test Plan Manually tested via ``` # quick inspection without pretty print cargo run -- python list --format json ``` ### Short example of output (trimmed down) Cmd: `cargo run -- python list --format json | jq '.[:2]'` ```json [ { "key": "cpython-3.13.1+freethreaded-linux-x86_64-gnu", "version": "3.13.1", "version_parts": { "major": 3, "minor": 13, "patch": 1 }, "path": null, "symlink": null, "url": "https://github.com/astral-sh/python-build-standalone/releases/download/20241219/cpython-3.13.1%2B20241219-x86_64-unknown-linux-gnu-freethreaded%2Bpgo%2Blto-full.tar.zst", "os": "linux", "variant": "freethreaded", "implementation": "cpython", "arch": "x86_64", "libc": "gnu" }, { "key": "cpython-3.13.1-linux-x86_64-gnu", "version": "3.13.1", "version_parts": { "major": 3, "minor": 13, "patch": 1 }, "path": "/usr/bin/python3.13", "symlink": null, "url": null, "os": "linux", "variant": "default", "implementation": "cpython", "arch": "x86_64", "libc": "gnu" } ] ``` --------- Co-authored-by: John Zlotek <jzlotek@gmail.com>
Would love to have this for non-interactive terminals! Any idea when this will be implemented? @Gankra |
This is gonna take a while and will have to be done piecemeal interface-by-interface. Some commands like Other commands that compile/install packages will probably benefit from a json-lines streaming output, like the one you can see in cargo/rustc's interface. It would be helpful to know what commands people specifically need/want this output from to prioritize. |
#1442 would be at the top of my list 🙂 |
|
Our main commands, especially pip-compile, should have a json output format that can be in downstream applications such as auditing, dependabot-like application and our own testing.
The text was updated successfully, but these errors were encountered: