blob: 12ae0faf2d0a47da75bf2226e38f071c1a400be1 [file] [log] [blame]
Serge Bazanski194b1c82020-09-25 20:24:17 +00001load("@rules_python//python:defs.bzl", "py_runtime_pair")
2
Serge Bazanski27885a92020-10-03 16:54:39 +02003# Python toolchain definition that uses //third_party/nix:python.nix (via
Serge Bazanski194b1c82020-09-25 20:24:17 +00004# external repository).
5
6py_runtime(
7 name = "py3_runtime",
8 interpreter = "@hscloud_nix_python3//:python3",
9 python_version = "PY3",
10)
11
Serge Bazanski27885a92020-10-03 16:54:39 +020012py_runtime(
13 name = "py2_runtime",
14 interpreter = "@hscloud_nix_python2//:python2",
15 python_version = "PY2",
16)
17
18
Serge Bazanski194b1c82020-09-25 20:24:17 +000019py_runtime_pair(
20 name = "py_runtime_pair",
Serge Bazanski27885a92020-10-03 16:54:39 +020021 py2_runtime = ":py2_runtime",
Serge Bazanski194b1c82020-09-25 20:24:17 +000022 py3_runtime = ":py3_runtime",
23)
24
25toolchain(
26 name = "py_toolchain",
27 toolchain = ":py_runtime_pair",
28 toolchain_type = "@rules_python//python:toolchain_type",
29)