Skip to content

Commit e5916e7

Browse files
committed
use hub aliases repo if available: wip finish multi_pip_parse if needed
1 parent 52d65dd commit e5916e7

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

WORKSPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ pip_parse(
129129
requirements_darwin = "//tools/publish:requirements_darwin.txt",
130130
requirements_lock = "//tools/publish:requirements_linux.txt",
131131
requirements_windows = "//tools/publish:requirements_windows.txt",
132-
use_hub_alias_dependencies = True,
133132
)
134133

135134
load("@rules_python_publish_deps//:requirements.bzl", "install_deps")

python/private/pypi/pip_repository.bzl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,16 @@ def _pip_repository_impl(rctx):
204204
rctx.file("BUILD.bazel", _BUILD_FILE_CONTENTS)
205205
rctx.template("requirements.bzl", rctx.attr._template, substitutions = {
206206
" # %%CONFIG_LIBRARY%%": """\
207-
whl_config_library(
207+
config_repo = "{name}__config"
208+
whl_config_repository(
208209
name = config_repo,
209-
whl_map = {
210-
p: "" for p in all_whl_requirements_by_package
211-
},
212-
)""",
210+
whl_map = {{
211+
p: ""
212+
for p in all_whl_requirements_by_package
213+
}},
214+
)""".format(name = rctx.attr.name) if not rctx.attr.use_hub_alias_dependencies else """\
215+
config_repo = "{name}"
216+
""".format(name = rctx.attr.name),
213217
" # %%GROUP_LIBRARY%%": """\
214218
group_repo = "{name}__groups"
215219
group_library(

python/private/pypi/requirements.bzl.tmpl.workspace

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,7 @@ def install_deps(**whl_library_kwargs):
5454

5555
# %%GROUP_LIBRARY%%
5656

57-
config_repo = "%%NAME%%__config"
58-
whl_config_repository(
59-
name = config_repo,
60-
whl_map = {
61-
p: ""
62-
for p in all_whl_requirements_by_package
63-
},
64-
)
57+
# %%CONFIG_LIBRARY%%
6558

6659
# Install wheels which may be participants in a group
6760
whl_config = dict(_config)

0 commit comments

Comments
 (0)