Add uv publish --dry-run (#15638)

## Summary

`uv publish --dry-run` will perform the `--check-url` validation, and
hit the `/validate` endpoint if the registry is known to support
fast-path validation (like pyx). The `/validate` endpoint lets us
validate an upload without uploading the file _contents_, which lets you
skip the expensive step for common mistakes.

In the future, my hope is that the `/validate` step will deprecated in
favor of Upload API 2.0.
This commit is contained in:
Charlie Marsh 2025-09-02 21:24:31 -04:00 committed by GitHub
parent b57ad179b6
commit 7606f1ad3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 187 additions and 25 deletions

View file

@ -6572,6 +6572,13 @@ pub struct PublishArgs {
#[arg(long, hide = true)]
pub skip_existing: bool,
/// Perform a dry run without uploading files.
///
/// When enabled, the command will check for existing files if `--check-url` is provided,
/// and will perform validation against the index if supported, but will not upload any files.
#[arg(long)]
pub dry_run: bool,
}
/// See [PEP 517](https://peps.python.org/pep-0517/) and