pbtk: mirror rules_python local toolchain deltas from MODULE.bazel to WORKSPACE
#test-continuous
PiperOrigin-RevId: 802565693
diff --git a/MODULE.bazel b/MODULE.bazel
index 322a304..1cb3170 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -44,7 +44,7 @@
bazel_dep(name = "rules_kotlin", version = "1.9.6")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
-bazel_dep(name = "rules_python", version = "1.6.0")
+bazel_dep(name = "rules_python", version = "1.4.2")
# Pin to rules_proto to 7.1.0 to avoid toolchain incompatibilities when
# --incompatible_enable_proto_toolchain_resolution=true in Bazel 7.
diff --git a/WORKSPACE b/WORKSPACE
index 5a4b2f4..343a08e 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -31,6 +31,21 @@
py_repositories()
+load("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_repo", "local_runtime_toolchains_repo")
+
+local_runtime_repo(
+ name = "local_python3",
+ interpreter_path = "python3",
+ on_failure = "fail",
+)
+
+local_runtime_toolchains_repo(
+ name = "local_toolchains",
+ runtimes = ["local_python3"],
+)
+
+register_toolchains("@local_toolchains//:all")
+
# Bazel platform rules.
http_archive(
name = "platforms",
diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel
index ab848dc..7514bfd 100644
--- a/examples/MODULE.bazel
+++ b/examples/MODULE.bazel
@@ -22,4 +22,4 @@
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "rules_java", version = "8.6.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
-bazel_dep(name = "rules_python", version = "1.6.0")
+bazel_dep(name = "rules_python", version = "1.4.2")
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index 2a2724c..45091b0 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -142,9 +142,9 @@
if not native.existing_rule("rules_python"):
http_archive(
name = "rules_python",
- sha256 = "fa7dd2c6b7d63b3585028dd8a90a6cf9db83c33b250959c2ee7b583a6c130e12",
- strip_prefix = "rules_python-1.6.0",
- url = "https://github.com/bazel-contrib/rules_python/releases/download/1.6.0/rules_python-1.6.0.tar.gz",
+ sha256 = "daf1c27517e8526c212195345b4f6f02dd8cad69aa099d3bdb11868458211829",
+ strip_prefix = "rules_python-1.4.2",
+ url = "https://github.com/bazel-contrib/rules_python/releases/download/1.4.2/rules_python-1.4.2.tar.gz",
)
if not native.existing_rule("system_python"):