-
Notifications
You must be signed in to change notification settings - Fork 337
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
Try telling who is requesting missing package #971
Try telling who is requesting missing package #971
Conversation
love this idea. I think allan is back from vacay maybe next week, I bet this is a quick merge and I would find very useful. |
I really like this too, simple and saves time trawling through |
Since I find #972 is also a helpful idea and much related with original implementation, I refactored the code and the logic can be shared in both cases. Here is my test cases, and the output would be as follows:
Update
|
There are a few issues here that make this not quite so straightforward. I like the idea though, but I think it has to be refined. The following are in order of severity: 1: It costs something to run 2: Dependency info is shown as a chain, but this doesn't reflect what's actually going on, since dependencies in the solve graph are parts of the DAG. For example, consider:
This may be true, but may also be disguising the fact that this is also true:
3: Similar to (2), the PackageFamilyNotFound error is not taking into account that multiple packages may have requested the missing package. I think we need to target this PR specifically at the PackageFamilyNotFound case for the moment. Performance is not an issue here because the exception is raised and the solve ends there. We only need to show the immediate packages that requested the missing package, and that doesn't require the generic In terms of what to do about (1) and (2), we can talk about that in a separate PR specifically made for that case. My 2c on that is that we should be able to generate a list of chains for each conflicting requirement, because this shows the right info (it's basically showing multiple flattened paths in a DAG). We can also do this post-solve. I don't think it's as bad as it seems though, and I think there may be an elegant solution. What you really need to do is get the solve graph (see Solver.get_graph), and extract all the conflict paths from that. There are three benefits to doing it this way:
I'm going to close this PR, as I want to get into the habit of doing that rather than leaving loads of PRs hanging. But as I said I think this is headed in the right direction, and a PR targeted at the PackageFamilyNotFound case should be straightforward. |
Thanks Alan, great hints ! ❤️
I'll submit another PR that only focusing on And yes, I'll go check out the graph and try that again. 👍🏼 |
Thanks @nerdvegas for the information and @davidlatwe for trying to do an initial implementation. Originally I opened #972 so I can have a go at it someday. It's more clear now, with the feedback from #971 (comment), on things to look out for when implementing it |
Problem
When requested package reqires a packge that is missing, error message only tells what was missing, but not telling which package has that requirement. Unless you crawl the resolving log with
verbose
enabled.For example:
Proposal
When
PackageFamilyNotFoundError
occurred, catch it internally and look up extracted requirements to find the dependent and re-raise another a bit more detailedPackageFamilyNotFoundError
.Result: