Skip to content
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

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Ignore tags in universal resolution #4174

merged 1 commit into from
Jun 10, 2024

Conversation

charliermarsh
Copy link
Member

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.

@charliermarsh charliermarsh merged commit 5269a0d into main Jun 10, 2024
46 checks passed
@charliermarsh charliermarsh deleted the charlie/tags branch June 10, 2024 12:38
Copy link
Member

@BurntSushi BurntSushi left a 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) {
Copy link
Member

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.

Copy link
Member Author

@charliermarsh charliermarsh Jun 10, 2024

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?

Copy link
Member

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 {
Copy link
Member

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(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Packages without source dists break universal resolver
3 participants