-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import Python Bazel rules from rules_python #1188
Comments
Note: An alternative is to use a hermetic toolchain from For MODULE.bazel: bazel_dep(name = "rules_python", version = "1.0.0")
PYTHON_VERSIONS = [
"3.10",
"3.11",
"3.12",
"3.13",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
[
python.toolchain(
is_default = python_version == PYTHON_VERSIONS[-1], # Choose last version as default.
python_version = python_version,
)
for python_version in PYTHON_VERSIONS
] Then apply the following patch: diff --git a/python/BUILD b/python/BUILD
index 12936ad..0afe833 100644
--- a/python/BUILD
+++ b/python/BUILD
@@ -4,7 +4,7 @@ cc_binary(
linkshared = 1,
deps = [
"//core:libjsonnet",
- "@default_python3_headers//:headers",
+ "@rules_python//python/cc:current_py_cc_headers",
],
) This allows removing |
/sub |
MODULE.bazel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rules such as
py_runtime
andpy_runtime_pair
are no longer part of Bazel core as of version 8.0.0 (released today), and should be imported from https://github.com/bazelbuild/rules_python/tree/main. These can be loaded through Bazel for now, by opting into a flag, but that ability is intended to go away in the next major release.The text was updated successfully, but these errors were encountered: