Fix functionality gaps of wheel resolver: support prereleases and all system tags#151
Closed
tm-jdelapuente wants to merge 1 commit intomasterfrom
Closed
Fix functionality gaps of wheel resolver: support prereleases and all system tags#151tm-jdelapuente wants to merge 1 commit intomasterfrom
tm-jdelapuente wants to merge 1 commit intomasterfrom
Conversation
tm-jdelapuente
commented
Aug 2, 2024
| # We're currently hardcoding PyPI but we should consider allowing other | ||
| # repositories | ||
| locator = distlib.locators.SimpleScrapingLocator(url="https://pypi.org/simple") | ||
| locator.wheel_tags = list(itertools.product(interpreter, abi, platform)) |
Contributor
Author
There was a problem hiding this comment.
This is where we're setting the locator to use sys_tags instead of the tags that distlib generates internally, which are less complete.
tm-jdelapuente
commented
Aug 2, 2024
| _LOGGER.debug("requirement: %r", requirement) | ||
|
|
||
| distribution = locator.locate(requirement) | ||
| distribution = locator.locate(requirement=requirement, prereleases=prereleases) |
Contributor
Author
There was a problem hiding this comment.
This is how we get disctlib to download prereleases
tm-jdelapuente
commented
Aug 2, 2024
| return url.endswith(".whl") | ||
|
|
||
|
|
||
| def _is_compatible(url: str, tags: typing.List[str]) -> bool: |
Contributor
Author
There was a problem hiding this comment.
We can remove _is_compatible because distlib already checks for tag compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problems
distlib's function that creates tags is less complete thanpackaging.tags.sys_tagsSolution
prereleases=Truetolocator.locatepackaging.tags.sys_tagswe create those tags and assign them tolocator.wheel_tagsUX change
Since this is OSS it's ideal to give users the ability to stop prereleases from being used. This would give people that work with Please more control over what dependencies get included within their organization.
To do this, the wheel resolver now takes a flag
prereleasesthat is set in.plzconfigunder the newPluginConfig"prereleases".