Add --show-urls and --only-downloads to uv python list (#8062)

These are useful for creating a mirror of the Python downloads for a
given uv version, e.g.:

```
❯ cargo run -q -- python list --show-urls --only-downloads
cpython-3.13.0-macos-aarch64-none     20241008/cpython-3.13.0%2B20241008-aarch64-apple-darwin-install_only_stripped.tar.gz
cpython-3.12.7-macos-aarch64-none     20241008/cpython-3.12.7%2B20241008-aarch64-apple-darwin-install_only_stripped.tar.gz
cpython-3.11.10-macos-aarch64-none    20241008/cpython-3.11.10%2B20241008-aarch64-apple-darwin-install_only_stripped.tar.gz
cpython-3.10.15-macos-aarch64-none    20241008/cpython-3.10.15%2B20241008-aarch64-apple-darwin-install_only_stripped.tar.gz
cpython-3.9.20-macos-aarch64-none     20241008/cpython-3.9.20%2B20241008-aarch64-apple-darwin-install_only_stripped.tar.gz
cpython-3.8.20-macos-aarch64-none     20241002/cpython-3.8.20%2B20241002-aarch64-apple-darwin-install_only_stripped.tar.gz
pypy-3.10.14-macos-aarch64-none       https://downloads.python.org/pypy/pypy3.10-v7.3.17-macos_arm64.tar.bz2
pypy-3.9.19-macos-aarch64-none        https://downloads.python.org/pypy/pypy3.9-v7.3.16-macos_arm64.tar.bz2
pypy-3.8.16-macos-aarch64-none        https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2
```
This commit is contained in:
Zanie Blue 2024-12-10 12:52:40 -06:00 committed by GitHub
parent 3ee2b10738
commit 624e79a8a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 111 additions and 55 deletions

View file

@ -4225,8 +4225,20 @@ pub struct PythonListArgs {
/// Only show installed Python versions, exclude available downloads.
///
/// By default, available downloads for the current platform are shown.
#[arg(long)]
#[arg(long, conflicts_with("only_downloads"))]
pub only_installed: bool,
/// Only show Python downloads, exclude installed distributions.
///
/// By default, available downloads for the current platform are shown.
#[arg(long, conflicts_with("only_installed"))]
pub only_downloads: bool,
/// Show the URLs of available Python downloads.
///
/// By default, these display as `<download available>`.
#[arg(long)]
pub show_urls: bool,
}
#[derive(Args)]