-
Notifications
You must be signed in to change notification settings - Fork 723
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
Ignore tags in universal resolution #4174
Conversation
5baed1f
to
a5283d1
Compare
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.
Nice!
} | ||
TagCompatibility::Compatible(priority) => priority, | ||
let priority = match tags { | ||
Some(tags) => match filename.compatibility(tags) { |
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.
Nit: I think this could be tags.map(|tags| match filename.compatibility(tags) { ... })
.
The tip-off was the None => None
branch below.
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 thought so too initially but we have an early return on line 174... Doesn't that cause problems?
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.
Oh derp, I missed the return
. Sorry!
return WheelCompatibility::Incompatible(IncompatibleWheel::Tag(tag)) | ||
} | ||
TagCompatibility::Compatible(priority) => priority, | ||
let priority = match &self.tags { |
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.
Nit: same as above, although I think this needs self.tags.as_ref().map(...)
.
Summary
If a package lacks a source distribution, and we can't find a compatible wheel for the current platform, we need to just assume that the package will have a valid wheel on all platforms on which it's requested; if not, we raise an error at install time.
It's possible that we can be smarter about this over time. For example, if the package was requested only for macOS, we could verify that there's at least one macOS-compatible wheel. See the linked issue for more details.
Closes #4139.