Skip existing, second iteration: Check the index before uploading (#8531)

Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
konsti 2024-10-31 16:23:12 +01:00 committed by GitHub
parent b52f229862
commit 082259493e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 487 additions and 223 deletions

View file

@ -4819,6 +4819,22 @@ pub struct PublishArgs {
value_parser = parse_insecure_host,
)]
pub allow_insecure_host: Option<Vec<Maybe<TrustedHost>>>,
/// Check an index URL for existing files to skip duplicate uploads.
///
/// This option allows retrying publishing that failed after only some, but not all files have
/// been uploaded, and handles error due to parallel uploads of the same file.
///
/// Before uploading, the index is checked. If the exact same file already exists in the index,
/// the file will not be uploaded. If an error occurred during the upload, the index is checked
/// again, to handle cases where the identical file was uploaded twice in parallel.
///
/// The exact behavior will vary based on the index. When uploading to PyPI, uploading the same
/// file succeeds even without `--check-url`, while most other indexes error.
///
/// The index must provide one of the supported hashes (SHA-256, SHA-384, or SHA-512).
#[arg(long,env = EnvVars::UV_PUBLISH_CHECK_URL)]
pub check_url: Option<IndexUrl>,
}
/// See [PEP 517](https://peps.python.org/pep-0517/) and