diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 234561c33204..eb6a304fc6d2 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -4311,7 +4311,8 @@ pub struct DisplayTreeArgs { pub struct PublishArgs { /// Paths to the files to upload. Accepts glob expressions. /// - /// Defaults to the `dist` directory. + /// Defaults to the `dist` directory. Selects only wheels and source distributions, while + /// ignoring other files. #[arg(default_value = "dist/*")] pub files: Vec, diff --git a/crates/uv-publish/src/lib.rs b/crates/uv-publish/src/lib.rs index ab23970b9a14..76b00b942a4b 100644 --- a/crates/uv-publish/src/lib.rs +++ b/crates/uv-publish/src/lib.rs @@ -38,7 +38,7 @@ pub enum PublishError { #[error("File is neither a wheel nor a source distribution: `{}`", _0.user_display())] InvalidFilename(PathBuf), #[error("Failed to publish: `{}`", _0.user_display())] - PublishPrepare(PathBuf, #[source] PublishPrepareError), + PublishPrepare(PathBuf, #[source] Box), #[error("Failed to publish `{}` to {}", _0.user_display(), _1)] PublishSend(PathBuf, Url, #[source] PublishSendError), } @@ -215,7 +215,7 @@ pub async fn upload( ) -> Result { let form_metadata = form_metadata(file, filename) .await - .map_err(|err| PublishError::PublishPrepare(file.to_path_buf(), err))?; + .map_err(|err| PublishError::PublishPrepare(file.to_path_buf(), Box::new(err)))?; let request = build_request( file, filename, @@ -226,7 +226,7 @@ pub async fn upload( form_metadata, ) .await - .map_err(|err| PublishError::PublishPrepare(file.to_path_buf(), err))?; + .map_err(|err| PublishError::PublishPrepare(file.to_path_buf(), Box::new(err)))?; let response = request.send().await.map_err(|err| { PublishError::PublishSend(file.to_path_buf(), registry.clone(), err.into()) diff --git a/crates/uv/src/commands/publish.rs b/crates/uv/src/commands/publish.rs index b501a700d393..84b5be894446 100644 --- a/crates/uv/src/commands/publish.rs +++ b/crates/uv/src/commands/publish.rs @@ -27,8 +27,8 @@ pub(crate) async fn publish( let files = files_for_publishing(paths)?; match files.len() { 0 => bail!("No files found to publish"), - 1 => writeln!(printer.stderr(), "Publishing 1 file")?, - n => writeln!(printer.stderr(), "Publishing {n} files")?, + 1 => writeln!(printer.stderr(), "Publishing 1 file to {publish_url}")?, + n => writeln!(printer.stderr(), "Publishing {n} files {publish_url}")?, } let client = BaseClientBuilder::new() diff --git a/crates/uv/tests/publish.rs b/crates/uv/tests/publish.rs index 6de1a85e2129..ec1cceaf7e53 100644 --- a/crates/uv/tests/publish.rs +++ b/crates/uv/tests/publish.rs @@ -14,7 +14,7 @@ fn username_password_no_longer_supported() { .arg("-p") .arg("dummy") .arg("--publish-url") - .arg("https://test.pypi.org/legacy") + .arg("https://test.pypi.org/legacy/") .arg("../../scripts/links/ok-1.0.0-py3-none-any.whl"), @r###" success: false exit_code: 2 @@ -22,10 +22,10 @@ fn username_password_no_longer_supported() { ----- stderr ----- warning: `uv publish` is experimental and may change without warning - Publishing 1 file + Publishing 1 file to https://test.pypi.org/legacy/ Uploading ok-1.0.0-py3-none-any.whl ([SIZE]) error: Failed to publish `../../scripts/links/ok-1.0.0-py3-none-any.whl` to https://test.pypi.org/legacy/ - Caused by: Permission denied (status code 403 Forbidden): 403 Username/Password authentication is no longer supported. Migrate to API Tokens or Trusted Publishers instead. See https://pypi.org/help/#apitoken and https://pypi.org/help/#trusted-publishers + Caused by: Permission denied (status code 403 Forbidden): 403 Username/Password authentication is no longer supported. Migrate to API Tokens or Trusted Publishers instead. See https://test.pypi.org/help/#apitoken and https://test.pypi.org/help/#trusted-publishers "### ); } @@ -40,7 +40,7 @@ fn invalid_token() { .arg("-p") .arg("dummy") .arg("--publish-url") - .arg("https://test.pypi.org/legacy") + .arg("https://test.pypi.org/legacy/") .arg("../../scripts/links/ok-1.0.0-py3-none-any.whl"), @r###" success: false exit_code: 2 @@ -48,10 +48,10 @@ fn invalid_token() { ----- stderr ----- warning: `uv publish` is experimental and may change without warning - Publishing 1 file + Publishing 1 file to https://test.pypi.org/legacy/ Uploading ok-1.0.0-py3-none-any.whl ([SIZE]) error: Failed to publish `../../scripts/links/ok-1.0.0-py3-none-any.whl` to https://test.pypi.org/legacy/ - Caused by: Permission denied (status code 403 Forbidden): 403 Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information. + Caused by: Permission denied (status code 403 Forbidden): 403 Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information. "### ); } diff --git a/docs/reference/cli.md b/docs/reference/cli.md index fdff503790ef..9ec4a70d9b3d 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -6792,7 +6792,7 @@ uv publish [OPTIONS] [FILES]...
FILES

Paths to the files to upload. Accepts glob expressions.

-

Defaults to the dist directory.

+

Defaults to the dist directory. Selects only wheels and source distributions, while ignoring other files.