internal: support repo prefixes and config settings in alias rendering#1756
Merged
aignas merged 10 commits intobazel-contrib:mainfrom Feb 15, 2024
Merged
internal: support repo prefixes and config settings in alias rendering#1756aignas merged 10 commits intobazel-contrib:mainfrom
aignas merged 10 commits intobazel-contrib:mainfrom
Conversation
Summary: - introduce a whl_alias struct to make code more object oriented. - make the interface of the function as small as possible. - unify the bzlmod and legacy code paths. - allow to specify arbitrary repo prefixes and config settings when generating aliases (split out from bazel-contrib#1744).
rickeylev
approved these changes
Feb 15, 2024
tests/pip_hub_repository/render_pkg_aliases/render_pkg_aliases_test.bzl
Outdated
Show resolved
Hide resolved
tests/pip_hub_repository/render_pkg_aliases/render_pkg_aliases_test.bzl
Outdated
Show resolved
Hide resolved
| repo_name = rctx.attr.repo_name, | ||
| rules_python = rctx.attr._template.workspace_name, | ||
| aliases = { | ||
| key: [whl_alias(**v) for v in json.decode(values)] |
Collaborator
There was a problem hiding this comment.
Out of scope for this PR, but I wonder if passing a file might work better than passing it as strings in regular attributes. The pip hub basically needs to be given all the possible backing repos and targets, right? Which could be rather large. Putting that in a file seems like it'd scale better than the string attributes.
Oh hm...and that sort of sounds like the sort of intermediate file Phil's thing has been circling around...
Collaborator
Author
There was a problem hiding this comment.
Interesting, I like the file idea, we could have a label-keyed dict here. Once I merge this, I can experiment with this idea.
Co-authored-by: Richard Levasseur <richardlev@gmail.com>
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 does not change any logic/features in the bzlmod or legacy code, but
just changes the interfaces and how the parameters are passed. The final
result should be the same.
Summary:
whl_aliasstruct to make code more object oriented.when generating aliases, which is useful in multi-platform hub
generation.