From 11e2906934445767eb128efcf292ef4298f2debc Mon Sep 17 00:00:00 2001 From: Kevin Gessner Date: Thu, 26 Mar 2020 18:33:13 -0400 Subject: [PATCH] pip_repository: support absolute python_interpreter (#27) --- defs.bzl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/defs.bzl b/defs.bzl index fe5cc3eda3..58e782f624 100644 --- a/defs.bzl +++ b/defs.bzl @@ -4,7 +4,10 @@ DEFAULT_REPOSITORY_NAME = "pip" def _pip_repository_impl(rctx): - if not rctx.which(rctx.attr.python_interpreter): + python_interpreter = rctx.attr.python_interpreter + if '/' not in python_interpreter: + python_interpreter = rctx.which(python_interpreter) + if not python_interpreter: fail("python interpreter not found") rctx.file("BUILD", "") @@ -20,7 +23,7 @@ def _pip_repository_impl(rctx): result = rctx.execute( [ - rctx.which(rctx.attr.python_interpreter), + python_interpreter, "-m", "extract_wheels", "--requirements",