diff --git a/src/MODULE.bazel b/src/MODULE.bazel index 2f8409cd04..edd3af4799 100644 --- a/src/MODULE.bazel +++ b/src/MODULE.bazel @@ -376,3 +376,30 @@ sha256 = "47a3e63e1379f707af9c49df5c4fa0534332173c73c61f93d14555673bed7599", url = "https://github.com/hiroyuki-komatsu/japanpost_zipcode/raw/33524763837473258e7ba2f14b17fc3a70519831/ken_all.zip", ) + +local_runtime_repo = use_repo_rule( + "@rules_python//python/local_toolchains:repos.bzl", + "local_runtime_repo", +) + +local_runtime_toolchains_repo = use_repo_rule( + "@rules_python//python/local_toolchains:repos.bzl", + "local_runtime_toolchains_repo", +) + +# Use local python instead of downloading a toolchain +# https://rules-python.readthedocs.io/en/latest/toolchains.html#local-toolchain +local_runtime_repo( + name = "local_python3", + interpreter_path = "python3", + on_failure = "fail", + dev_dependency = True +) + +local_runtime_toolchains_repo( + name = "local_toolchains", + runtimes = ["local_python3"], + dev_dependency = True +) + +register_toolchains("@local_toolchains//:all", dev_dependency = True)