-
Notifications
You must be signed in to change notification settings - Fork 662
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
Backtrack on distributions with invalid metadata #2834
Conversation
UnavailablePackage::Unparseable => { | ||
"was found, but the metadata could not be parsed" | ||
} |
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.
👍 This is the kind of thing that would be improved by generic metadata in PubGrub... I started work on it but it's a lot.
997de86
to
4600848
Compare
## Summary Demonstrates some suboptimal behavior in how we handle invalid metadata, which are fixed in #2834. The included wheels were modified by-hand to include invalid structures.
ca77459
to
d3cb9f9
Compare
|
||
× No solution found when resolving dependencies: | ||
╰─▶ Because validation==2.0.0 is unusable because its dependencies are | ||
unusable because the package metadata could not be parsed and you |
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.
@zanieb - Is there any way for me to improve this (the triple "because") without larger refactors?
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.
Can I make Dependencies::Unavailable
accept an enum or something?
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.
Maybe you could switch it from a string to an enum but uhh I'm not really sure. This is the idea behind a generic incompatibility metadata type in PubGrub.
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.
If I can do it, do you mind if I do it?
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.
No I don't mind it seems like a step in the right direction
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.
I'll add separately.
d3cb9f9
to
658bfeb
Compare
@@ -1100,8 +1100,7 @@ fn mismatched_name() -> Result<()> { | |||
----- stdout ----- | |||
|
|||
----- stderr ----- | |||
error: Failed to read: foo @ file://[TEMP_DIR]/foo-2.0.1-py3-none-any.whl | |||
Caused by: The .dist-info directory tomli-2.0.1 does not start with the normalized package name: foo | |||
error: Because foo was found, but has an invalid format and you require foo, we can conclude that the requirements are unsatisfiable. |
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.
This is slightly worse... I guess I could make the "reasons" more specific?
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.
Maybe the .dist-info
thing is so broken that we shouldn't backtrack. IDK.
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.
Hm it's a little weird to throw the no solution error this way (i.e. compared to how it's formatted elsewhere)
You could push the detailed reasons into some hints?
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.
Hm it's a little weird to throw the no solution error this way (i.e. compared to how it's formatted elsewhere)
What do you mean by this?
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.
error: Because foo was found, ...
vs
× No solution found when resolving dependencies:
╰─▶ Because you require ...
I don't mind the lack of the arrow and such but the "No solution found" part seems relevant.
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.
Ah yeah. I'll add separately.
658bfeb
to
f101da3
Compare
Filed issues for the follow-ups. |
Summary
Closes #2821.