Skip to content

Commit

Permalink
uv publish is in preview
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Sep 21, 2024
1 parent e27bdc9 commit 2d5af07
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/uv-configuration/src/preview.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::fmt::{Display, Formatter};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
pub enum PreviewMode {
#[default]
Disabled,
Expand Down
5 changes: 5 additions & 0 deletions crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,11 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
}
Commands::Publish(args) => {
show_settings!(args);

if globals.preview.is_disabled() {
warn_user_once!("`uv.sources` is experimental and may change without warning");
}

// Resolve the settings from the command-line arguments and workspace configuration.
let PublishSettings {
files,
Expand Down
2 changes: 2 additions & 0 deletions crates/uv/tests/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn username_password_no_longer_supported() {
----- stdout -----
----- stderr -----
warning: `uv.sources` is experimental and may change without warning
Publishing 1 file
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://upload.pypi.org/legacy/`
Expand All @@ -42,6 +43,7 @@ fn invalid_token() {
----- stdout -----
----- stderr -----
warning: `uv.sources` is experimental and may change without warning
Publishing 1 file
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://upload.pypi.org/legacy/`
Expand Down

0 comments on commit 2d5af07

Please sign in to comment.