Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,9 @@ pub enum PipCommand {
after_long_help = ""
)]
Check(PipCheckArgs),
/// Display debug information (unsupported)
#[command(hide = true)]
Debug(PipDebugArgs),
}

#[derive(Subcommand)]
Expand Down Expand Up @@ -2732,6 +2735,21 @@ pub struct PipTreeArgs {
pub compat_args: compat::PipGlobalCompatArgs,
}

#[derive(Args)]
pub struct PipDebugArgs {
#[arg(long, hide = true)]
pub platform: Option<String>,

#[arg(long, hide = true)]
pub python_version: Option<String>,

#[arg(long, hide = true)]
pub implementation: Option<String>,

#[arg(long, hide = true)]
pub abi: Option<String>,
}

#[derive(Args)]
pub struct BuildArgs {
/// The directory from which distributions should be built, or a source
Expand Down
7 changes: 6 additions & 1 deletion crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::str::FromStr;
use std::sync::atomic::Ordering;

use anstream::eprintln;
use anyhow::{Result, bail};
use anyhow::{Result, anyhow, bail};
use clap::error::{ContextKind, ContextValue};
use clap::{CommandFactory, Parser};
use futures::FutureExt;
Expand Down Expand Up @@ -1054,6 +1054,11 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
globals.preview,
)
}
Commands::Pip(PipNamespace {
command: PipCommand::Debug(_),
}) => Err(anyhow!(
"pip's `debug` is unsupported (consider using `uvx pip debug` instead)"
)),
Commands::Cache(CacheNamespace {
command: CacheCommand::Clean(args),
})
Expand Down
8 changes: 8 additions & 0 deletions crates/uv/tests/it/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,14 @@ impl TestContext {
command
}

/// Create a `pip debug` command for testing.
pub fn pip_debug(&self) -> Command {
let mut command = Self::new_command();
command.arg("pip").arg("debug");
self.add_shared_options(&mut command, true);
command
}

/// Create a `uv help` command with options shared across scenarios.
#[allow(clippy::unused_self)]
pub fn help(&self) -> Command {
Expand Down
1 change: 1 addition & 0 deletions crates/uv/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ mod pip_show;
#[cfg(all(feature = "python", feature = "pypi"))]
mod pip_sync;

mod pip_debug;
mod pip_tree;
mod pip_uninstall;

Expand Down
16 changes: 16 additions & 0 deletions crates/uv/tests/it/pip_debug.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use crate::common::{TestContext, uv_snapshot};

#[test]
fn debug_warn() {
let context = TestContext::new("3.12");

uv_snapshot!(context.pip_debug(), @r"
success: false
exit_code: 2
----- stdout -----

----- stderr -----
error: pip's `debug` is unsupported (consider using `uvx pip debug` instead)
"
);
}
Loading