mirror of https://github.com/astral-sh/uv
<!-- 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: - https://github.com/astral-sh/uv/issues/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> |
||
|---|---|---|
| .. | ||
| policies | ||
| benchmarks.md | ||
| build_failures.md | ||
| cli.md | ||
| index.md | ||
| resolver-internals.md | ||
| settings.md | ||