Skip to content

Commit

Permalink
pip_repository: support absolute python_interpreter (bazelbuild#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingessner authored Mar 26, 2020
1 parent b981944 commit 11e2906
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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", "")
Expand All @@ -20,7 +23,7 @@ def _pip_repository_impl(rctx):

result = rctx.execute(
[
rctx.which(rctx.attr.python_interpreter),
python_interpreter,
"-m",
"extract_wheels",
"--requirements",
Expand Down

0 comments on commit 11e2906

Please sign in to comment.