File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Original file line number Diff line number Diff line change 13
13
# limitations under the License.
14
14
"""Import .whl files into Bazel."""
15
15
16
+ def _find_python (repository_ctx ):
17
+ if "BAZEL_PYTHON" in repository_ctx .os .environ :
18
+ return repository_ctx .os .environ .get ("BAZEL_PYTHON" )
19
+
20
+ python_path = repository_ctx .which ("python" )
21
+ if not python_path :
22
+ python_path = repository_ctx .which ("python.exe" )
23
+ if python_path :
24
+ return python_path
25
+
26
+ fail ("rules_python requires a python interpreter installed. " +
27
+ "Please set BAZEL_PYTHON, or put it on your path." )
28
+
16
29
def _whl_impl (repository_ctx ):
17
30
"""Core implementation of whl_library."""
18
31
19
32
args = [
20
- "python" ,
33
+ _find_python ( repository_ctx ) ,
21
34
repository_ctx .path (repository_ctx .attr ._script ),
22
35
"--whl" ,
23
36
repository_ctx .path (repository_ctx .attr .whl ),
You can’t perform that action at this time.
0 commit comments