Implement --invert for pip tree (#4621)

## Summary

Part of https://github.com/astral-sh/uv/issues/4439.

## Test Plan

Existing tests pass + added a couple of new tests with `--invert`.
This commit is contained in:
Chan Kang 2024-07-01 12:58:28 -04:00 committed by GitHub
parent 0ee4a2cc6e
commit 5715def24b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 342 additions and 27 deletions

View file

@ -1436,6 +1436,10 @@ pub struct PipTreeArgs {
#[arg(long)]
pub no_dedupe: bool,
#[arg(long, alias = "reverse")]
/// Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package.
pub invert: bool,
/// Validate the virtual environment, to detect packages with missing dependencies or other
/// issues.
#[arg(long, overrides_with("no_strict"))]