Skip to content

Commit dafdbc9

Browse files
committed
feat: add Python 3.12 toolchain registration
rules_python 1.x requires explicit toolchain setup and no longer auto-registers toolchains. Register Python 3.12 toolchain to ensure Python tools work correctly with Bazel 9.
1 parent 6604887 commit dafdbc9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

MODULE.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,15 @@ pip.parse(
190190
)
191191
use_repo(pip, "codegen_deps")
192192

193+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
194+
python.toolchain(
195+
is_default = True,
196+
python_version = "3.12",
197+
)
198+
use_repo(python, "python_3_12", "python_versions")
199+
200+
register_toolchains("@python_versions//3.12:all")
201+
193202
swift_deps = use_extension("//swift/third_party:load.bzl", "swift_deps")
194203

195204
# following list can be kept in sync with `bazel mod tidy`

0 commit comments

Comments
 (0)