-
-
Notifications
You must be signed in to change notification settings - Fork 650
internal: support repo prefixes and config settings in alias rendering #1756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3054c6f
cf84eb8
1d8fb10
99b7907
7c8f47d
ec848ec
4ce9f6b
f0ecdf2
d625627
598e864
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
|
|
||
| "" | ||
|
|
||
| load("//python/private:render_pkg_aliases.bzl", "render_pkg_aliases") | ||
| load("//python/private:render_pkg_aliases.bzl", "render_pkg_aliases", "whl_alias") | ||
| load("//python/private:text_util.bzl", "render") | ||
|
|
||
| _BUILD_FILE_CONTENTS = """\ | ||
|
|
@@ -27,10 +27,11 @@ exports_files(["requirements.bzl"]) | |
| def _pip_repository_impl(rctx): | ||
| bzl_packages = rctx.attr.whl_map.keys() | ||
| aliases = render_pkg_aliases( | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, I like the file idea, we could have a |
||
| for key, values in rctx.attr.whl_map.items() | ||
| }, | ||
| default_version = rctx.attr.default_version, | ||
| whl_map = rctx.attr.whl_map, | ||
| ) | ||
| for path, contents in aliases.items(): | ||
| rctx.file(path, contents) | ||
|
|
@@ -71,9 +72,12 @@ setting.""", | |
| mandatory = True, | ||
| doc = "The apparent name of the repo. This is needed because in bzlmod, the name attribute becomes the canonical name.", | ||
| ), | ||
| "whl_map": attr.string_list_dict( | ||
| "whl_map": attr.string_dict( | ||
| mandatory = True, | ||
| doc = "The wheel map where values are python versions", | ||
| doc = """\ | ||
| The wheel map where values are json.encoded strings of the whl_map constructed | ||
| in the pip.parse tag class. | ||
| """, | ||
| ), | ||
| "_template": attr.label( | ||
| default = ":requirements.bzl.tmpl", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.