diff --git a/crates/uv-configuration/src/preview.rs b/crates/uv-configuration/src/preview.rs index 38572589b667..39fffa649265 100644 --- a/crates/uv-configuration/src/preview.rs +++ b/crates/uv-configuration/src/preview.rs @@ -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, diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index fc36bf494ccd..a1df00439ac8 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -1067,6 +1067,11 @@ async fn run(cli: Cli) -> Result { } 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, diff --git a/crates/uv/tests/publish.rs b/crates/uv/tests/publish.rs index d06221c41041..ef06f07df399 100644 --- a/crates/uv/tests/publish.rs +++ b/crates/uv/tests/publish.rs @@ -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/` @@ -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/`