Skip to content

Commit 6d61c4d

Browse files
committed
Add a stub uv pip debug announcing lack of support
1 parent ed63be5 commit 6d61c4d

5 files changed

Lines changed: 49 additions & 0 deletions

File tree

crates/uv-cli/src/lib.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,9 @@ pub enum PipCommand {
10091009
after_long_help = ""
10101010
)]
10111011
Check(PipCheckArgs),
1012+
/// Display debug information (not implemented)
1013+
#[command(hide = true)]
1014+
Debug(PipDebugArgs),
10121015
}
10131016

10141017
#[derive(Subcommand)]
@@ -2732,6 +2735,21 @@ pub struct PipTreeArgs {
27322735
pub compat_args: compat::PipGlobalCompatArgs,
27332736
}
27342737

2738+
#[derive(Args)]
2739+
pub struct PipDebugArgs {
2740+
#[arg(long, hide = true)]
2741+
pub platform: Option<String>,
2742+
2743+
#[arg(long, hide = true)]
2744+
pub python_version: Option<String>,
2745+
2746+
#[arg(long, hide = true)]
2747+
pub implementation: Option<String>,
2748+
2749+
#[arg(long, hide = true)]
2750+
pub abi: Option<String>,
2751+
}
2752+
27352753
#[derive(Args)]
27362754
pub struct BuildArgs {
27372755
/// The directory from which distributions should be built, or a source

crates/uv/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,12 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
10541054
globals.preview,
10551055
)
10561056
}
1057+
Commands::Pip(PipNamespace {
1058+
command: PipCommand::Debug(_),
1059+
}) => {
1060+
warn_user_once!("The `debug` subcommand is not present in `uv pip`");
1061+
Ok(ExitStatus::Error)
1062+
}
10571063
Commands::Cache(CacheNamespace {
10581064
command: CacheCommand::Clean(args),
10591065
})

crates/uv/tests/it/common/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

crates/uv/tests/it/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ mod pip_show;
7272
#[cfg(all(feature = "python", feature = "pypi"))]
7373
mod pip_sync;
7474

75+
mod pip_debug;
7576
mod pip_tree;
7677
mod pip_uninstall;
7778

crates/uv/tests/it/pip_debug.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
warning: The `debug` subcommand is not present in `uv pip`
14+
"
15+
);
16+
}

0 commit comments

Comments
 (0)