Skip to content

Fix recursive use of maybe in pip_repository rules. #612

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

Closed
wants to merge 15 commits into from
20 changes: 10 additions & 10 deletions python/pip_install/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
""
"""Dependencies used for pip rules"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

# Avoid a load from @bazel_skylib repository as users don't necessarily have it installed
load("//third_party/github.com/bazelbuild/bazel-skylib/lib:versions.bzl", "versions")
Expand Down Expand Up @@ -118,12 +117,13 @@ def pip_install_dependencies():
# repository rules so it's likely that most users get the right error.
versions.check("4.0.0")

existing_rules = native.existing_rules()
for (name, url, sha256) in _RULE_DEPS:
maybe(
http_archive,
name,
url = url,
sha256 = sha256,
type = "zip",
build_file_content = _GENERIC_WHEEL,
)
if name not in existing_rules:
http_archive(
name = name,
url = url,
sha256 = sha256,
type = "zip",
build_file_content = _GENERIC_WHEEL,
)