Skip to content

Commit 4ec2d26

Browse files
committed
Use maybe for rules_python repo
Without this `maybe` the `rules_python` repo will override any prior `rules_python` specified by the workspace - which is unexpected.
1 parent b06983b commit 4ec2d26

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bazel/repos.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
1313
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
14+
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
1415

1516
def repos(external = True, repo_mapping = {}):
1617
"""Adds repositories/archives needed by pyprotoc-plugin
@@ -21,7 +22,8 @@ def repos(external = True, repo_mapping = {}):
2122
repo_mapping: passed through to all other functions that expect/use
2223
repo_mapping, e.g., 'git_repository'
2324
"""
24-
http_archive(
25+
maybe(
26+
http_archive,
2527
name = "rules_python",
2628
sha256 = "9acc0944c94adb23fba1c9988b48768b1bacc6583b52a2586895c5b7491e2e31",
2729
strip_prefix = "rules_python-0.27.0",

0 commit comments

Comments
 (0)