Skip to content

Commit 2b1963f

Browse files
brettchabotcopybara-androidxtest
authored andcommitted
Bazel: configure python to ignore root user error.
PiperOrigin-RevId: 740053802
1 parent 3f15a6f commit 2b1963f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

MODULE.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,23 @@ bazel_dep(name = "rules_kotlin", version = "2.1.3", repo_name = "io_bazel_rules_
1010
bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf")
1111
bazel_dep(name = "grpc-java", version = GRPC_VERSION)
1212
bazel_dep(name = "rules_robolectric", version = "4.14.1.2", repo_name = "robolectric")
13+
bazel_dep(name = "rules_python", version = "1.2.0")
1314

1415
# Pin the version of rules_robolectric so that it matches the robolectric version we get from maven.
1516
single_version_override(
1617
module_name = "rules_robolectric",
1718
version = "4.14.1.2",
1819
)
1920

21+
# python setup
22+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
23+
python.toolchain(
24+
is_default = True,
25+
python_version = "3.12.8",
26+
# See https://github.com/bazel-contrib/rules_python/issues/1169#issuecomment-1513804247
27+
ignore_root_user_error = True,
28+
)
29+
2030
# maven dependencies
2131
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
2232

0 commit comments

Comments
 (0)