Skip to content

Commit a70a1b1

Browse files
authored
[bazel] add python 3.10 runtime pair (#58455)
getting ready to run things on python 3.10 Signed-off-by: Lonnie Liu <[email protected]>
1 parent 412220e commit a70a1b1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

WORKSPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ python_register_toolchains(
6666
register_toolchains = False,
6767
)
6868

69+
python_register_toolchains(
70+
name = "python3_10",
71+
python_version = "3.10",
72+
register_toolchains = False,
73+
)
74+
6975
load("@python3_9//:defs.bzl", python39 = "interpreter")
7076
load("@rules_python//python/pip_install:repositories.bzl", "pip_install_dependencies")
7177

bazel/BUILD.bazel

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@python3_9//:defs.bzl", python39 = "interpreter")
2+
load("@python3_10//:defs.bzl", python310 = "interpreter")
23
load("@py_deps_buildkite//:requirements.bzl", ci_require = "requirement")
34
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_runtime", "py_runtime_pair")
45

@@ -82,3 +83,24 @@ toolchain(
8283
toolchain = ":py39_runtime_pair",
8384
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
8485
)
86+
87+
py_runtime(
88+
name = "py310_runtime",
89+
interpreter = python310,
90+
python_version = "PY3",
91+
visibility = ["//visibility:private"],
92+
)
93+
94+
py_runtime_pair(
95+
name = "py310_runtime_pair",
96+
py2_runtime = None,
97+
py3_runtime = ":py310_runtime",
98+
visibility = ["//visibility:private"],
99+
)
100+
101+
toolchain(
102+
name = "py310_toolchain",
103+
exec_compatible_with = ["//:hermetic_python"],
104+
toolchain = ":py310_runtime_pair",
105+
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
106+
)

0 commit comments

Comments
 (0)