Skip to content

Commit

Permalink
Update py_runtime_pair to properly declare config transitions.
Browse files Browse the repository at this point in the history
This is phase 1 of of the switch to toolchain transitions. See #11584 for details.

Closes #12038.

PiperOrigin-RevId: 332439975
  • Loading branch information
katre authored and copybara-github committed Sep 18, 2020
1 parent 5cead30 commit 5f944e0
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tools/python/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,24 @@ def _py_runtime_pair_impl(ctx):
py_runtime_pair = rule(
implementation = _py_runtime_pair_impl,
attrs = {
"py2_runtime": attr.label(providers = [PyRuntimeInfo], doc = """\
# The two runtimes are used by the py_binary at runtime, and so need to
# be built for the target platform.
"py2_runtime": attr.label(
providers = [PyRuntimeInfo],
cfg = "target",
doc = """\
The runtime to use for Python 2 targets. Must have `python_version` set to
`PY2`.
"""),
"py3_runtime": attr.label(providers = [PyRuntimeInfo], doc = """\
""",
),
"py3_runtime": attr.label(
providers = [PyRuntimeInfo],
cfg = "target",
doc = """\
The runtime to use for Python 3 targets. Must have `python_version` set to
`PY3`.
"""),
""",
),
},
doc = """\
A toolchain rule for Python.
Expand Down

0 comments on commit 5f944e0

Please sign in to comment.