Skip to content

Ignore tags in universal resolution - #4174

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/tags
Jun 10, 2024
Merged

charliermarsh merged 1 commit into
mainfrom
charlie/tags

Conversation

@charliermarsh

Copy link
Copy Markdown
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 added the preview Experimental behavior label Jun 9, 2024
@charliermarsh
charliermarsh merged commit 5269a0d into main Jun 10, 2024
@charliermarsh
charliermarsh deleted the charlie/tags branch June 10, 2024 12:38

@BurntSushi BurntSushi left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

@charliermarsh charliermarsh Jun 10, 2024 •

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
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