File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed
Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff 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, hidden = true ) ]
4870+ pub skip_existing : bool ,
48684871}
48694872
48704873/// See [PEP 517](https://peps.python.org/pep-0517/) and
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use std::path::Path;
66use std:: process:: ExitCode ;
77
88use anstream:: eprintln;
9- use anyhow:: Result ;
9+ use anyhow:: { bail , Result } ;
1010use clap:: error:: { ContextKind , ContextValue } ;
1111use clap:: { CommandFactory , Parser } ;
1212use 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,
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments