From 27d64a2351b98d48dd5b18c75ff536982a4ce26a Mon Sep 17 00:00:00 2001 From: James Sharpe Date: Tue, 18 Jul 2023 08:40:54 +0100 Subject: [PATCH] Update bzlmod support to new rules_python extension API (#1633) Co-authored-by: dominic <510002+dmah42@users.noreply.github.com> --- MODULE.bazel | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 46212429..459609d3 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,7 +4,7 @@ bazel_dep(name = "bazel_skylib", version = "1.4.1") bazel_dep(name = "platforms", version = "0.0.6") bazel_dep(name = "rules_foreign_cc", version = "0.9.0") bazel_dep(name = "rules_cc", version = "0.0.6") -bazel_dep(name = "rules_python", version = "0.23.1") +bazel_dep(name = "rules_python", version = "0.24.0") bazel_dep(name = "googletest", version = "1.12.1", repo_name = "com_google_googletest") bazel_dep(name = "libpfm", version = "4.11.0") @@ -16,19 +16,9 @@ bazel_dep(name = "libpfm", version = "4.11.0") python = use_extension("@rules_python//python/extensions:python.bzl", "python") python.toolchain(python_version = "3.9") -# Extract the interpreter from the hermetic toolchain above, so we can use that -# instead of the system interpreter for the pip compiplation step below. -interpreter = use_extension("@rules_python//python/extensions:interpreter.bzl", "interpreter") -interpreter.install( - name = "interpreter", - python_name = "python_3_9", -) -use_repo(interpreter, "interpreter") - pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") pip.parse( - name="tools_pip_deps", - incompatible_generate_aliases = True, - python_interpreter_target="@interpreter//:python", + hub_name="tools_pip_deps", + python_version = "3.9", requirements_lock="//tools:requirements.txt") use_repo(pip, "tools_pip_deps")