Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)