Skip to content

Commit

Permalink
Update bzlmod support to new rules_python extension API (google#1633)
Browse files Browse the repository at this point in the history
Co-authored-by: dominic <[email protected]>
  • Loading branch information
jsharpe and dmah42 authored Jul 18, 2023
1 parent c5997e0 commit 27d64a2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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")

0 comments on commit 27d64a2

Please sign in to comment.