File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1009,6 +1009,9 @@ pub enum PipCommand {
10091009 after_long_help = ""
10101010 ) ]
10111011 Check ( PipCheckArgs ) ,
1012+ /// Display debug information (unsupported)
1013+ #[ command( hide = true ) ]
1014+ Debug ( PipDebugArgs ) ,
10121015}
10131016
10141017#[ derive( Subcommand ) ]
@@ -2756,6 +2759,21 @@ pub struct PipTreeArgs {
27562759 pub compat_args : compat:: PipGlobalCompatArgs ,
27572760}
27582761
2762+ #[ derive( Args ) ]
2763+ pub struct PipDebugArgs {
2764+ #[ arg( long, hide = true ) ]
2765+ pub platform : Option < String > ,
2766+
2767+ #[ arg( long, hide = true ) ]
2768+ pub python_version : Option < String > ,
2769+
2770+ #[ arg( long, hide = true ) ]
2771+ pub implementation : Option < String > ,
2772+
2773+ #[ arg( long, hide = true ) ]
2774+ pub abi : Option < String > ,
2775+ }
2776+
27592777#[ derive( Args ) ]
27602778pub struct BuildArgs {
27612779 /// The directory from which distributions should be built, or a source
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use std::str::FromStr;
1212use std:: sync:: atomic:: Ordering ;
1313
1414use anstream:: eprintln;
15- use anyhow:: { Result , bail} ;
15+ use anyhow:: { Result , anyhow , bail} ;
1616use clap:: error:: { ContextKind , ContextValue } ;
1717use clap:: { CommandFactory , Parser } ;
1818use futures:: FutureExt ;
@@ -1060,6 +1060,11 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
10601060 globals. preview ,
10611061 )
10621062 }
1063+ Commands :: Pip ( PipNamespace {
1064+ command : PipCommand :: Debug ( _) ,
1065+ } ) => Err ( anyhow ! (
1066+ "pip's `debug` is unsupported (consider using `uvx pip debug` instead)"
1067+ ) ) ,
10631068 Commands :: Cache ( CacheNamespace {
10641069 command : CacheCommand :: Clean ( args) ,
10651070 } )
Original file line number Diff line number Diff line change @@ -1104,6 +1104,14 @@ impl TestContext {
11041104 command
11051105 }
11061106
1107+ /// Create a `pip debug` command for testing.
1108+ pub fn pip_debug ( & self ) -> Command {
1109+ let mut command = Self :: new_command ( ) ;
1110+ command. arg ( "pip" ) . arg ( "debug" ) ;
1111+ self . add_shared_options ( & mut command, true ) ;
1112+ command
1113+ }
1114+
11071115 /// Create a `uv help` command with options shared across scenarios.
11081116 #[ allow( clippy:: unused_self) ]
11091117 pub fn help ( & self ) -> Command {
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ mod pip_show;
7272#[ cfg( all( feature = "python" , feature = "pypi" ) ) ]
7373mod pip_sync;
7474
75+ mod pip_debug;
7576mod pip_tree;
7677mod pip_uninstall;
7778
Original file line number Diff line number Diff line change 1+ use crate :: common:: { TestContext , uv_snapshot} ;
2+
3+ #[ test]
4+ fn debug_warn ( ) {
5+ let context = TestContext :: new ( "3.12" ) ;
6+
7+ uv_snapshot ! ( context. pip_debug( ) , @r"
8+ success: false
9+ exit_code: 2
10+ ----- stdout -----
11+
12+ ----- stderr -----
13+ error: pip's `debug` is unsupported (consider using `uvx pip debug` instead)
14+ "
15+ ) ;
16+ }
You can’t perform that action at this time.
0 commit comments