tensorflow/third_party/py/BUILD.tpl
A. Unique TensorFlower 3eae65361b Update rules_python to v1.6 in XLA and TensorFlow projects.
`com_google_protobuf` and `rules_cc` initialization was moved to `python_init_rules` macros.

The JAX repository update will be done [in the next step](https://github.com/jax-ml/jax/pull/31709)

PiperOrigin-RevId: 808689003
2025-09-18 12:30:45 -07:00

52 lines
1.4 KiB
Smarty

licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
# Point both runtimes to the same python binary to ensure we always
# use the python binary specified by ./configure.py script.
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
py_runtime(
name = "py2_runtime",
interpreter = "%{PYTHON_INTERPRETER}",
python_version = "PY2",
)
py_runtime(
name = "py3_runtime",
interpreter = "%{PYTHON_INTERPRETER}",
python_version = "PY3",
)
py_runtime_pair(
name = "py_runtime_pair",
py2_runtime = ":py2_runtime",
py3_runtime = ":py3_runtime",
)
toolchain(
name = "py_toolchain",
toolchain = ":py_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
target_compatible_with = [%{PLATFORM_CONSTRAINT}],
exec_compatible_with = [%{PLATFORM_CONSTRAINT}],
)
alias(name = "python_headers",
actual = "@rules_python//python/cc:current_py_cc_headers")
# This alias is exists for the use of targets in the @llvm-project dependency,
# which expect a python_headers target called @python_runtime//:headers. We use
# a repo_mapping to alias python_runtime to this package, and an alias to create
# the correct target.
alias(
name = "headers",
actual = ":python_headers",
)
config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
visibility = ["//visibility:public"],
)