Implement --package for pip tree (#4655)

## Summary

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

## Test Plan

The existing tests pass + added a couple of tests to ensure `--package` behaves as expected.
This commit is contained in:
Chan Kang 2024-07-01 17:12:59 -04:00 committed by GitHub
parent a4417eba4a
commit 61014d48b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 185 additions and 9 deletions

View file

@ -1428,6 +1428,11 @@ pub struct PipTreeArgs {
/// Prune the given package from the display of the dependency tree.
#[arg(long)]
pub prune: Vec<PackageName>,
/// Display only the specified packages.
#[arg(long)]
pub package: Vec<PackageName>,
/// Do not de-duplicate repeated dependencies.
/// Usually, when a package has already displayed its dependencies,
/// further occurrences will not re-display its dependencies,