aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/compatibility/BUILD
diff options
context:
space:
mode:
authorGravatar Andrew Selle <aselle@google.com>2017-01-10 14:05:10 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-01-10 14:23:31 -0800
commit3e59f0540ede856294eba374cd3d00231d90d5c9 (patch)
tree0e0d2ac8c22672397752d8c0232786e6f314799c /tensorflow/tools/compatibility/BUILD
parente2730973b1bfac9031c639660d8d6e1c2a76b86e (diff)
Basic version of TensorFlow 1.0 Upgrade Script.
This script currently is minimally tested. It is a work in progress currently. Change: 144125570
Diffstat (limited to 'tensorflow/tools/compatibility/BUILD')
-rw-r--r--tensorflow/tools/compatibility/BUILD83
1 files changed, 83 insertions, 0 deletions
diff --git a/tensorflow/tools/compatibility/BUILD b/tensorflow/tools/compatibility/BUILD
new file mode 100644
index 0000000000..0f3de10a0a
--- /dev/null
+++ b/tensorflow/tools/compatibility/BUILD
@@ -0,0 +1,83 @@
+licenses(["notice"]) # Apache 2.0
+
+package(default_visibility = ["//tensorflow:internal"])
+
+load(
+ "//tensorflow:tensorflow.bzl",
+ "tf_copts", # @unused
+ "tf_cc_test", # @unused
+)
+
+py_binary(
+ name = "tf_upgrade",
+ srcs = ["tf_upgrade.py"],
+ srcs_version = "PY2AND3",
+)
+
+py_test(
+ name = "tf_upgrade_test",
+ srcs = ["tf_upgrade_test.py"],
+ srcs_version = "PY2AND3",
+ deps = [
+ "tf_upgrade",
+ "//tensorflow:tensorflow_py",
+ ],
+)
+
+# Keep for reference, this test will succeed in 0.11 but fail in 1.0
+# py_test(
+# name = "test_file_v0_11",
+# size = "small",
+# srcs = ["testdata/test_file_v0_11.py"],
+# srcs_version = "PY2AND3",
+# deps = [
+# "//tensorflow:tensorflow_py",
+# ],
+# )
+
+genrule(
+ name = "generate_upgraded_file",
+ testonly = 1,
+ srcs = ["testdata/test_file_v0_11.py"],
+ outs = [
+ "test_file_v1_0.py",
+ "report.txt",
+ ],
+ cmd = ("$(location tf_upgrade)" +
+ " --infile $(location testdata/test_file_v0_11.py)" +
+ " --outfile $(location test_file_v1_0.py)" +
+ " --reportfile $(location report.txt)"),
+ tools = ["tf_upgrade"],
+)
+
+py_test(
+ name = "test_file_v1_0",
+ size = "small",
+ srcs = ["test_file_v1_0.py"],
+ srcs_version = "PY2AND3",
+ deps = [
+ "//tensorflow:tensorflow_py",
+ ],
+)
+
+exports_files(
+ [
+ "tf_upgrade.py",
+ "testdata/test_file_v0_11.py",
+ ],
+)
+
+# -----------------------------------------------------------------------------
+# Google-internal targets. These must be at the end for syncrepo.
+
+filegroup(
+ name = "all_files",
+ srcs = glob(
+ ["**/*"],
+ exclude = [
+ "**/METADATA",
+ "**/OWNERS",
+ ],
+ ),
+ visibility = ["//tensorflow:__subpackages__"],
+)