Serge Bazanski | 194b1c8 | 2020-09-25 20:24:17 +0000 | [diff] [blame] | 1 | load("@rules_python//python:defs.bzl", "py_runtime_pair") |
| 2 | |
Serge Bazanski | 27885a9 | 2020-10-03 16:54:39 +0200 | [diff] [blame] | 3 | # Python toolchain definition that uses //third_party/nix:python.nix (via |
Serge Bazanski | 194b1c8 | 2020-09-25 20:24:17 +0000 | [diff] [blame] | 4 | # external repository). |
| 5 | |
| 6 | py_runtime( |
| 7 | name = "py3_runtime", |
| 8 | interpreter = "@hscloud_nix_python3//:python3", |
| 9 | python_version = "PY3", |
| 10 | ) |
| 11 | |
Serge Bazanski | 27885a9 | 2020-10-03 16:54:39 +0200 | [diff] [blame] | 12 | py_runtime( |
| 13 | name = "py2_runtime", |
| 14 | interpreter = "@hscloud_nix_python2//:python2", |
| 15 | python_version = "PY2", |
| 16 | ) |
| 17 | |
| 18 | |
Serge Bazanski | 194b1c8 | 2020-09-25 20:24:17 +0000 | [diff] [blame] | 19 | py_runtime_pair( |
| 20 | name = "py_runtime_pair", |
Serge Bazanski | 27885a9 | 2020-10-03 16:54:39 +0200 | [diff] [blame] | 21 | py2_runtime = ":py2_runtime", |
Serge Bazanski | 194b1c8 | 2020-09-25 20:24:17 +0000 | [diff] [blame] | 22 | py3_runtime = ":py3_runtime", |
| 23 | ) |
| 24 | |
| 25 | toolchain( |
| 26 | name = "py_toolchain", |
| 27 | toolchain = ":py_runtime_pair", |
| 28 | toolchain_type = "@rules_python//python:toolchain_type", |
| 29 | ) |