aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Justine Tunney <jart@google.com>2017-06-14 19:08:34 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-14 19:12:58 -0700
commit4ac7cc54c81984e38da7a17992a56f62560e2870 (patch)
treed8bd0ca426bae9ebeac323f9b9146c0b41c844a5
parent7d3497a639670d9c31d09185ff97b852f0fbe101 (diff)
Add backports.weakref to Bazel build
This way people using Bazel don't have to pip install it. PiperOrigin-RevId: 159057260
-rw-r--r--tensorflow/python/BUILD1
-rwxr-xr-xtensorflow/tools/ci_build/install/install_pip_packages.sh3
-rwxr-xr-xtensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh3
-rw-r--r--tensorflow/tools/pip_package/BUILD1
-rw-r--r--tensorflow/workspace.bzl25
-rw-r--r--third_party/backports_weakref.BUILD22
6 files changed, 47 insertions, 8 deletions
diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index 10afd4f346..4a395290e0 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -2464,6 +2464,7 @@ py_library(
srcs_version = "PY2AND3",
deps = [
"//third_party/py/numpy",
+ "@org_python_pypi_backports_weakref",
"@protobuf//:protobuf_python",
"@six_archive//:six",
],
diff --git a/tensorflow/tools/ci_build/install/install_pip_packages.sh b/tensorflow/tools/ci_build/install/install_pip_packages.sh
index 8768852dc7..b8f9fc8453 100755
--- a/tensorflow/tools/ci_build/install/install_pip_packages.sh
+++ b/tensorflow/tools/ci_build/install/install_pip_packages.sh
@@ -85,6 +85,3 @@ pip2 install mock
pip2 install portpicker
pip3 install portpicker
-
-pip2 install backports.weakref==1.0rc1
-pip3 install backports.weakref==1.0rc1
diff --git a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
index edfc4e3a98..e7e2d256cd 100755
--- a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
+++ b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
@@ -89,6 +89,3 @@ pip3.5 install wheel==0.29.0
pip3.5 install portpicker
pip3.5 install werkzeug
-
-pip3.5 install backports.weakref==1.0rc1
-
diff --git a/tensorflow/tools/pip_package/BUILD b/tensorflow/tools/pip_package/BUILD
index 798338d787..fa51086922 100644
--- a/tensorflow/tools/pip_package/BUILD
+++ b/tensorflow/tools/pip_package/BUILD
@@ -122,6 +122,7 @@ filegroup(
"@six_archive//:LICENSE",
"@snappy//:COPYING",
"@zlib_archive//:zlib.h",
+ "@org_python_pypi_backports_weakref//:LICENSE",
] + if_not_windows([
"@nccl_archive//:LICENSE.txt",
]) + tf_additional_license_deps(),
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index de5525b0f2..01f12ee8db 100644
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -291,13 +291,35 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
name = "six_archive",
urls = [
"http://mirror.bazel.build/pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
- "http://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
+ "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
],
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
strip_prefix = "six-1.10.0",
build_file = str(Label("//third_party:six.BUILD")),
)
+ native.new_http_archive(
+ name = "org_python_pypi_backports_weakref",
+ urls = [
+ "http://mirror.bazel.build/pypi.python.org/packages/bc/cc/3cdb0a02e7e96f6c70bd971bc8a90b8463fda83e264fa9c5c1c98ceabd81/backports.weakref-1.0rc1.tar.gz",
+ "https://pypi.python.org/packages/bc/cc/3cdb0a02e7e96f6c70bd971bc8a90b8463fda83e264fa9c5c1c98ceabd81/backports.weakref-1.0rc1.tar.gz",
+ ],
+ sha256 = "8813bf712a66b3d8b85dc289e1104ed220f1878cf981e2fe756dfaabe9a82892",
+ strip_prefix = "backports.weakref-1.0rc1/src",
+ build_file = str(Label("//third_party:backports_weakref.BUILD")),
+ )
+
+ filegroup_external(
+ name = "org_python_license",
+ licenses = ["notice"], # Python 2.0
+ sha256_urls = {
+ "b5556e921715ddb9242c076cae3963f483aa47266c5e37ea4c187f77cc79501c": [
+ "http://mirror.bazel.build/docs.python.org/2.7/_sources/license.txt",
+ "https://docs.python.org/2.7/_sources/license.txt",
+ ],
+ },
+ )
+
native.bind(
name = "six",
actual = "@six_archive//:six",
@@ -622,4 +644,3 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
strip_prefix = "pprof-c0fb62ec88c411cc91194465e54db2632845b650",
build_file = str(Label("//third_party:pprof.BUILD")),
)
-
diff --git a/third_party/backports_weakref.BUILD b/third_party/backports_weakref.BUILD
new file mode 100644
index 0000000000..0adfc5f054
--- /dev/null
+++ b/third_party/backports_weakref.BUILD
@@ -0,0 +1,22 @@
+# Description:
+# Backport of new features in Python's weakref module.
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"]) # Python 2.0
+
+py_library(
+ name = "org_python_pypi_backports_weakref",
+ srcs = [
+ "backports/__init__.py",
+ "backports/weakref.py",
+ ],
+ srcs_version = "PY2AND3",
+)
+
+genrule(
+ name = "license",
+ srcs = ["@org_python_license"],
+ outs = ["LICENSE"],
+ cmd = "cp $< $@",
+)