fix: Don't require default Python version for pip hubs#1344
Merged
chrislovecnm merged 1 commit intobazel-contrib:mainfrom Jul 31, 2023
Merged
fix: Don't require default Python version for pip hubs#1344chrislovecnm merged 1 commit intobazel-contrib:mainfrom
chrislovecnm merged 1 commit intobazel-contrib:mainfrom
Conversation
6dabe02 to
e52e34c
Compare
This fixes the issue where a sub-module was required to always have a pip.parse() call configured for the default Python version if they used any pip.parse() call. Such a requirement puts sub-modules in an impossible situation: If they don't have the default version, they'll get an error. If they register the default version, but also register a specific version, they'll potentially cause an error if a root module changes the default to match their specific version (becaues two pip.parse() calls for the same version are made). The requirement to have the default version registered for a pip hub was only present to satisfy the `whl_library_alias` repository rule, which needed a Ptyhon version to map `//conditions:default` to. To fix, the `whl_library_alias` rule's `default_version` arg is made optional. When None is passed, the `//condiitions:default` condition is replaced with a `no_match_error` setting. This prevents the pip hub from being used with the version-unaware rules, but that makes sense: no wheels were setup for that version, so it's not like there is something that can be used anyways. Fixes bazel-contrib#1320
e52e34c to
fe8c1e5
Compare
Collaborator
Author
|
OK, CI is happy now. PTAL |
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.
This fixes the issue where a sub-module was required to always have a pip.parse() call configured for the default Python version if it used any pip.parse() call. Such a
requirement puts sub-modules in an impossible situation:
they'll potentially cause an error if a root module changes the default to
match their specific version (because two pip.parse() calls for the same version
are made, which is an error).
The requirement to have the default version registered for a pip hub was only present to satisfy the
whl_library_aliasrepository rule, which needed a Python version to map//conditions:defaultto.To fix, the
whl_library_aliasrule'sdefault_versionarg is made optional. When None is passed, the//conditions:defaultcondition is replaced with ano_match_errorsetting. This prevents the pip hub from being used with the version-unaware rules, but that makes sense: no wheels were setup for that version, so it's not like there is something thatcan be used anyways.
Fixes #1320