Skip to content

Commit f876616

Browse files
committed
Publish: Hint at --skip-existing -> --check-url transition
1 parent ef8724c commit f876616

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

crates/uv-cli/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4863,8 +4863,11 @@ pub struct PublishArgs {
48634863
/// file succeeds even without `--check-url`, while most other indexes error.
48644864
///
48654865
/// The index must provide one of the supported hashes (SHA-256, SHA-384, or SHA-512).
4866-
#[arg(long,env = EnvVars::UV_PUBLISH_CHECK_URL)]
4866+
#[arg(long, env = EnvVars::UV_PUBLISH_CHECK_URL)]
48674867
pub check_url: Option<IndexUrl>,
4868+
4869+
#[arg(long, hide = true)]
4870+
pub skip_existing: bool,
48684871
}
48694872

48704873
/// See [PEP 517](https://peps.python.org/pep-0517/) and

crates/uv/src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::path::Path;
66
use std::process::ExitCode;
77

88
use anstream::eprintln;
9-
use anyhow::Result;
9+
use anyhow::{bail, Result};
1010
use clap::error::{ContextKind, ContextValue};
1111
use clap::{CommandFactory, Parser};
1212
use owo_colors::OwoColorize;
@@ -1128,6 +1128,13 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
11281128
warn_user_once!("`uv publish` is experimental and may change without warning");
11291129
}
11301130

1131+
if args.skip_existing {
1132+
bail!(
1133+
"`uv publish` does not support `--skip-existing`, \
1134+
use `--check-url` with the simple index URL instead."
1135+
);
1136+
}
1137+
11311138
// Resolve the settings from the command-line arguments and workspace configuration.
11321139
let PublishSettings {
11331140
files,

crates/uv/tests/it/publish.rs

+20
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,23 @@ fn no_credentials() {
142142
"###
143143
);
144144
}
145+
146+
/// Hint people that it's not `--skip-existing` but `--check-url`.
147+
#[test]
148+
fn skip_existing_redirect() {
149+
let context = TestContext::new("3.12");
150+
151+
uv_snapshot!(context.filters(), context.publish()
152+
.arg("--skip-existing")
153+
.arg("--publish-url")
154+
.arg("https://test.pypi.org/legacy/"), @r###"
155+
success: false
156+
exit_code: 2
157+
----- stdout -----
158+
159+
----- stderr -----
160+
warning: `uv publish` is experimental and may change without warning
161+
error: `uv publish` does not support `--skip-existing`, use `--check-url` with the simple index URL instead.
162+
"###
163+
);
164+
}

0 commit comments

Comments
 (0)