refactor: don't depend on @bazel_tools//tools/python files (#4236)
Bazel is trimming unused content from `@bazel_tools`
(bazelbuild/bazel#31549, bazelbuild/bazel#31692). The root `//:bzl`
filegroup currently blocks the removal of
`@bazel_tools//tools/python` `.bzl` files that are otherwise unused:
* The root `//:bzl` filegroup re-exports
`@bazel_tools//tools/python:{python_version,srcs_version,toolchain,utils}.bzl`.
rules_python doesn't load any of them; `srcs_version.bzl`,
`toolchain.bzl` and `utils.bzl` have no remaining users
(`py_runtime_pair` in `toolchain.bzl` just fails since Bazel 8).
Before: `//:bzl` contains these four files. After: it only contains
rules_python's own `.bzl` files.
The remaining references to `@bazel_tools//tools/python` (the toolchain
type, the `python_version` flag, the interpreter path constraints, and
`_bootstrap_template`) are unchanged.
---------
Co-authored-by: Richard Levasseur <richardlev@gmail.com>
diff --git a/BUILD.bazel b/BUILD.bazel
index 9013928..1c0984f 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -93,13 +93,8 @@
filegroup(
name = "bzl",
srcs = [
- "//python/pip_install:bzl",
"//python:bzl",
- # Requires Bazel 0.29 onward for public visibility of these .bzl files.
- "@bazel_tools//tools/python:python_version.bzl",
- "@bazel_tools//tools/python:srcs_version.bzl",
- "@bazel_tools//tools/python:toolchain.bzl",
- "@bazel_tools//tools/python:utils.bzl",
+ "//python/pip_install:bzl",
],
visibility = ["//visibility:public"],
)