Pump force Python version & simplify code

pull/17644/head
Lidi Zheng 6 years ago
parent 0d931d9c8f
commit 7105626569
  1. 4
      third_party/py/python_configure.bzl
  2. 1
      tools/bazel.rc

@ -138,9 +138,7 @@ def _symlink_genrule_for_dir(repository_ctx,
def _get_python_bin(repository_ctx):
"""Gets the python bin path."""
python_bin = repository_ctx.os.environ.get(_PYTHON_BIN_PATH)
if python_bin == None:
python_bin = 'python'
python_bin = repository_ctx.os.environ.get(_PYTHON_BIN_PATH, 'python')
python_bin_path = repository_ctx.which(python_bin)
if python_bin_path != None:
return str(python_bin_path)

@ -59,4 +59,5 @@ build:basicprof --copt=-DGRPC_BASIC_PROFILER
build:basicprof --copt=-DGRPC_TIMERS_RDTSC
build:python3 --python_path=python3
build:python3 --force_python=PY3
build:python3 --action_env=PYTHON_BIN_PATH=python3

Loading…
Cancel
Save