File tree 3 files changed +32
-2
lines changed
3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -4863,8 +4863,11 @@ pub struct PublishArgs {
4863
4863
/// file succeeds even without `--check-url`, while most other indexes error.
4864
4864
///
4865
4865
/// 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 ) ]
4867
4867
pub check_url : Option < IndexUrl > ,
4868
+
4869
+ #[ arg( long, hidden = true ) ]
4870
+ pub skip_existing : bool ,
4868
4871
}
4869
4872
4870
4873
/// 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;
6
6
use std:: process:: ExitCode ;
7
7
8
8
use anstream:: eprintln;
9
- use anyhow:: Result ;
9
+ use anyhow:: { bail , Result } ;
10
10
use clap:: error:: { ContextKind , ContextValue } ;
11
11
use clap:: { CommandFactory , Parser } ;
12
12
use owo_colors:: OwoColorize ;
@@ -1128,6 +1128,13 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
1128
1128
warn_user_once ! ( "`uv publish` is experimental and may change without warning" ) ;
1129
1129
}
1130
1130
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
+
1131
1138
// Resolve the settings from the command-line arguments and workspace configuration.
1132
1139
let PublishSettings {
1133
1140
files,
Original file line number Diff line number Diff line change @@ -142,3 +142,23 @@ fn no_credentials() {
142
142
"###
143
143
) ;
144
144
}
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