From 4ec2d26bb6d1ce6ea0b5f0155e83037eeaf77293 Mon Sep 17 00:00:00 2001 From: Robert-Jan Huijsman <22160949+rjhuijsman@users.noreply.github.com> Date: Wed, 20 Aug 2025 09:22:05 +0000 Subject: [PATCH] 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. --- bazel/repos.bzl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bazel/repos.bzl b/bazel/repos.bzl index a5cf218..fe099cf 100644 --- a/bazel/repos.bzl +++ b/bazel/repos.bzl @@ -11,6 +11,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def repos(external = True, repo_mapping = {}): """Adds repositories/archives needed by pyprotoc-plugin @@ -21,7 +22,8 @@ def repos(external = True, repo_mapping = {}): repo_mapping: passed through to all other functions that expect/use repo_mapping, e.g., 'git_repository' """ - http_archive( + maybe( + http_archive, name = "rules_python", sha256 = "9acc0944c94adb23fba1c9988b48768b1bacc6583b52a2586895c5b7491e2e31", strip_prefix = "rules_python-0.27.0",