diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-06-15 17:19:13 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-06-15 17:23:07 -0700 |
commit | 2ebbffe87059fdc8ed66aa59cfa810af87029abb (patch) | |
tree | 78de4dc47feb08e8475bc4fd162929e2a84db63d /third_party/py | |
parent | 6bcb0391f144322c0eda536a02f568817302793d (diff) |
Enable setting remote configuration for cuda and python as an env variable
PiperOrigin-RevId: 159176334
Diffstat (limited to 'third_party/py')
-rw-r--r-- | third_party/py/python_configure.bzl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl index b4a98af7b6..19a6f1e749 100644 --- a/third_party/py/python_configure.bzl +++ b/third_party/py/python_configure.bzl @@ -13,6 +13,7 @@ _NUMPY_INCLUDE_PATH = "NUMPY_INCLUDE_PATH" _PYTHON_BIN_PATH = "PYTHON_BIN_PATH" _PYTHON_INCLUDE_PATH = "PYTHON_INCLUDE_PATH" _PYTHON_LIB_PATH = "PYTHON_LIB_PATH" +_TF_PYTHON_CONFIG_REPO = "TF_PYTHON_CONFIG_REPO" def _tpl(repository_ctx, tpl, substitutions={}, out=None): @@ -278,18 +279,20 @@ def _create_local_python_repository(repository_ctx): }) -def _create_remote_python_repository(repository_ctx): +def _create_remote_python_repository(repository_ctx, remote_config_repo): """Creates pointers to a remotely configured repo set up to build with Python. """ _tpl(repository_ctx, "remote.BUILD", { - "%{REMOTE_PYTHON_REPO}": repository_ctx.attr.remote_config_repo, + "%{REMOTE_PYTHON_REPO}": remote_config_repo, }, "BUILD") def _python_autoconf_impl(repository_ctx): """Implementation of the python_autoconf repository rule.""" - if repository_ctx.attr.remote_config_repo != "": - _create_remote_python_repository(repository_ctx) + remote_config_repo = _get_env_var(repository_ctx, _TF_PYTHON_CONFIG_REPO, + repository_ctx.attr.remote_config_repo, False) + if remote_config_repo != "": + _create_remote_python_repository(repository_ctx, remote_config_repo) else: _create_local_python_repository(repository_ctx) @@ -307,6 +310,7 @@ python_configure = repository_rule( _PYTHON_INCLUDE_PATH, _PYTHON_LIB_PATH, _NUMPY_INCLUDE_PATH, + _TF_PYTHON_CONFIG_REPO, ], ) """Detects and configures the local Python. |