-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Dependency tree command #1069
Conversation
He @abkfenris, thanks for the PR. This is already a very good start, I gave it a go and it does most of what I expect from a first version. To improve and align with the The It would be nice if you could also write some documentation. I'll do a technical review later! |
In the help text
I assume this will require a package/multiple packages as another argument, otherwise it will fail? So maybe make it
|
fixes: prefix-dev#238 Adds a tree command for the CLI that can print out the tree of dependencies based on those defined in pixi.toml. Additionally it can filter the regular dependency tree, or show what tree of packages need a given package. It keeps track of visits for the regular tree, but currently does not for the inverted one.
Ok, I went and quickly rebased it off of main to split it off from my tinkering with |
Does not fully understand normalized names and markers
I think the error with |
see #1074 |
Ah, I missed that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, it already works pretty nicely! I left some ideas for improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, it already works pretty nicely! I left some ideas for improvement.
Co-authored-by: Ruben Arts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
The code is not really handling the dependencies between conda and pypi properly (see PypiPackageIdentifier
) but for a first implementation this LGTM.
I left a few small comments
Co-authored-by: Pavel Zwerschke <[email protected]> Co-authored-by: Bas Zalmstra <[email protected]>
I've had the chance to already play around with What I noticed is that in some cases it doesn't behave as it should(?) [project]
name = "tmp.yqbLiIBFp9"
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64"]
[tasks]
[dependencies]
mlflow = "1.27.0"
For some reason, pandas and pandas-profiling are not part of the tree 🤔 |
Hmm, I'd have to try with that environment to be sure, but have you tried the latest commit? I had some issues with normalization for a few which meant that things were getting dropped. |
i thought that i used the latest commit but i'm not sure anymore... i'll try again after lunch 🙌🏻 |
I can reproduce it on my machine @pavelzw |
I also just tested again with |
All dependencies without a version in the "dependencies" of the package are missing from the tree. So also |
Thanks! I think I know right where that would be coming from. I'll tweak that and test it after I grab breakfast. |
Ah sorry I now read this, but I hope you don't mind me fixing it. I also renamed parts of the function as it was hard to grasp the variables at first. Let me know what you think. |
That works for me. I don't have that great of a handle on all the possible iterators, so I was gonna slap an |
Talking about real-world scenarious, I ended up using |
Another thing I stumbled upon: when running
The error message is good but there might be use cases where you want to only have a sub-tree of your whole tree. not a deal-breaker though and i'm really happy how his turned out 🚀 |
@pavelzw that is a good point, lets get this in and fix that in a following PR, as I also can't wait for this PR. |
Go ahead @abkfenris 👍 |
When a regex pattern is given to `pixi tree` and a top level dependency isn't matched, it currently errors rather than showing any matching transitive dependencies. This prints transitive dependencies in separate trees, similar to `pixi tree -i <package_name>`. Builds on prefix-dev#1069
When a regex pattern is given to `pixi tree` and a top level dependency isn't matched, it currently errors rather than showing any matching transitive dependencies. This prints transitive dependencies in separate trees, similar to `pixi tree -i <package_name>`. Builds on prefix-dev#1069
Ok, draft of transitive matching over on #1111 |
fixes: #238
A really rough pass at a
pixi tree
command, based off ofcargo tree
andmamba repoquery
.I had an idea that I didn't actually expect to work that I started tinkering around while working on another branch ( #1055 ), so it isn't very clean, but since folks are interested in playing with it.
It does:
It does not or is not:
Know how to start with PyPI dependenciesShow versions on an inverted treepixi list
and kept tweaking till something worked.Full tree:
Filtered tree
Inverted
Help