Skip to content

Commit 11e2906

Browse files
authored
pip_repository: support absolute python_interpreter (#27)
1 parent b981944 commit 11e2906

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

defs.bzl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ DEFAULT_REPOSITORY_NAME = "pip"
44

55

66
def _pip_repository_impl(rctx):
7-
if not rctx.which(rctx.attr.python_interpreter):
7+
python_interpreter = rctx.attr.python_interpreter
8+
if '/' not in python_interpreter:
9+
python_interpreter = rctx.which(python_interpreter)
10+
if not python_interpreter:
811
fail("python interpreter not found")
912

1013
rctx.file("BUILD", "")
@@ -20,7 +23,7 @@ def _pip_repository_impl(rctx):
2023

2124
result = rctx.execute(
2225
[
23-
rctx.which(rctx.attr.python_interpreter),
26+
python_interpreter,
2427
"-m",
2528
"extract_wheels",
2629
"--requirements",

0 commit comments

Comments
 (0)