Skip to content

Commit 27a965d

Browse files
committed
chore: use python.defaults to set rules_python default python version
python.defaults is the modern way to set the default. Setting it this way also helps avoid a bug where if a root module has a single `python.toolchain()` call (which are implicitly treated as `is_default=True`) and also sets the default using `python.defaults()`, some validation logic gives an error about using both ways to set a default.
1 parent e8f5b1d commit 27a965d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

MODULE.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ use_repo(
3737
# We need to do another use_extension call to expose the "pythons_hub"
3838
# repo.
3939
python = use_extension("//python/extensions:python.bzl", "python")
40+
python.defaults(
41+
python_version = "3.11",
42+
)
4043

4144
# The default toolchain to use if nobody configures a toolchain.
4245
# NOTE: This is not a stable version. It is provided for convenience, but will

0 commit comments

Comments
 (0)