uv/docs
Aria Desires 692171c718
add --output-format=json flag to uv python list (#10596)
<!--
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": "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>
2025-01-14 11:47:49 -05:00
..
.overrides Use | for page separator in meta titles (#6953) 2024-09-03 00:42:59 +00:00
assets Add static assets to docs pages (#6951) 2024-09-02 20:00:30 -04:00
concepts docs: Clarify build system specific features usage. (#10261) 2025-01-09 11:41:04 -06:00
configuration Add Git LFS support to uv-git crate (#10335) 2025-01-13 21:48:06 +00:00
getting-started Bump version to v0.5.18 (#10499) 2025-01-11 14:38:26 +00:00
guides typo (#10538) 2025-01-12 09:07:04 -06:00
js Add support for anchor redirects with client-side js (#9212) 2024-11-19 22:32:43 -06:00
pip Fix small typo in editable packages docs (#10257) 2024-12-31 22:23:07 -05:00
reference add --output-format=json flag to uv python list (#10596) 2025-01-14 11:47:49 -05:00
stylesheets Add breadcrumbs to the documentation (#9242) 2024-11-19 22:31:43 -06:00
.gitignore Add structured documentation (#4426) 2024-06-26 11:28:42 -05:00
index.md Remove pypy from top-level pin example (#9896) 2024-12-14 12:00:13 -06:00
requirements-insiders.in Reference the root requirements from the insiders requirements file (#5105) 2024-07-16 09:51:16 -05:00
requirements-insiders.txt Reorganize the project concept documentation (#9121) 2024-11-19 13:52:12 -06:00
requirements.in Reorganize the project concept documentation (#9121) 2024-11-19 13:52:12 -06:00
requirements.txt Reorganize the project concept documentation (#9121) 2024-11-19 13:52:12 -06:00