Repository navigation
Conversation
This is controlled by the --requires and --required-by flags and only works when the output format is JSON.
|
As I was doing more research about this, I noticed that pypa/pip#11097 is prior art, where incorporating arbitrary metadata into the output of |
|
Hi team, wondering if you’ve had a chance to think about if this is the right form factor for exposing this information. Thank you! |
Gankra
left a comment
There was a problem hiding this comment.
Apologies for the delay! I think the basic idea looks reasonable, I mostly have a few quibbles about the structure.
| #[arg(long, overrides_with("no_requires"))] | ||
| pub requires: bool, |
There was a problem hiding this comment.
Based on the semantics you've implemented this seems like this should also include conflicts_with = "required_by".
| #[arg(long, overrides_with("requires"), hide = true)] | ||
| pub no_requires: bool, |
There was a problem hiding this comment.
Hmm what's the usecase for having this opt out flag too?
| results | ||
| }; | ||
|
|
||
| let requires_map = if requires || required_by { |
There was a problem hiding this comment.
I'd prefer to structure this as
let requires_map = requires.then(|| { ... });
let required_by_map = required_by.then(|| { ... });
As-is it's weird to have this shared variable for two conceptually independent results just because they happen to have the same type. It's also not clear to me that these need to be mutually exclusive outputs? (And if that's the case, ignore the note above about the cli conflicts_with)
|
I'm also wondering about how this fits into our CLI... like |
|
I guess more broadly it's unclear if we should have |
|
I didn't have time to follow up on this, so I'm going to close this to reduce noise. Sorry about that! |
Summary
This is controlled by the
--requiresand--required-byflags and only works when the output format is JSON.This addresses part of #4711, but I agree with #4711 (comment) that it belongs in
uv pip listinstead ofuv pip tree. A few notes about this:--requiresand--required-byto match theRequiresandRequired-Byfields that appear in the output ofuv pip show.name. This leaves the door open to add more fields to each dependency in the future, such as installed version and requested versions.I'm hoping to get some early feedback on this PR to test the temperature of this approach, before I proceed. The remaining work as I see it currently includes:
uv pip treeinstead).Test Plan