fix: Don't require default Python version for pip hubs #1344
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_alias
repository rule, which needed a Python version to map//conditions:default
to.To fix, the
whl_library_alias
rule'sdefault_version
arg is made optional. When None is passed, the//conditions:default
condition is replaced with ano_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 thatcan be used anyways.
Fixes #1320