fix(pypi): fix the whl selection algorithm after #2069 #2078
+110
−119
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.
It seems that a few things broke in recent commits:
MODULE.bazel.lock
file and it seems that it is easy tomiss when the components in the PyPI extension stop integrating well
together. This happened during the switch to
{abi}_{os}_{plat}
targetplatform passing within the code.
to add the
rule_name
.repo_utils.getenv
was always gettingPATH
env var on bazel6.x
.This PR fixes both cases and updates docs to serve as a better reminder. By
fixing the
select_whls
code and we can just rely on target platform triples(ABI, OS, CPU). This gets one step closer to maybe supporting optional
python_version
which would address #1708. Whilst at it we are also addingdifferent status messages for building the wheel from
sdist
vs justextracting or downloading the wheel.
Tests:
MODULE.bazel.lock
files in ourrules_python
extension before refactor(pypi): split out more utils and start passing 'abi_os_arch' around #2069 and after this PR and there are nodifferences except in the
experimental_target_platforms
attribute inwhl_library
. Before this PR you would see that we do not select any wheelsfor e.g.
MarkupSafe
and we are always building fromsdist
.Work towards #260.