Skip to content

Commit 2d20670

Browse files
committed
feat(internal): support inferring the config settings from dist filenames
This code will use the config settings generated by `pip_config_settings` in all cases and when the `whl_alias` instances are generated by passing `filename` values, then we will also use the platform-specific config settings from the `//_config` package in the hub repo.
1 parent 870cada commit 2d20670

File tree

5 files changed

+890
-65
lines changed

5 files changed

+890
-65
lines changed

python/private/bzlmod/pip_repository.bzl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414

1515
""
1616

17-
load("//python/private:render_pkg_aliases.bzl", "render_pkg_aliases", "whl_alias")
17+
load(
18+
"//python/private:render_pkg_aliases.bzl",
19+
"render_multiplatform_pkg_aliases",
20+
"whl_alias",
21+
)
1822
load("//python/private:text_util.bzl", "render")
1923

2024
_BUILD_FILE_CONTENTS = """\
@@ -26,12 +30,13 @@ exports_files(["requirements.bzl"])
2630

2731
def _pip_repository_impl(rctx):
2832
bzl_packages = rctx.attr.whl_map.keys()
29-
aliases = render_pkg_aliases(
33+
aliases = render_multiplatform_pkg_aliases(
3034
aliases = {
3135
key: [whl_alias(**v) for v in json.decode(values)]
3236
for key, values in rctx.attr.whl_map.items()
3337
},
3438
default_version = rctx.attr.default_version,
39+
default_config_setting = "//_config:is_python_" + rctx.attr.default_version,
3540
requirement_cycles = rctx.attr.groups,
3641
)
3742
for path, contents in aliases.items():

0 commit comments

Comments
 (0)