Split py_binary into py_binary and py_library to avoid having py_binary in deps.

PiperOrigin-RevId: 236369592
This commit is contained in:
A. Unique TensorFlower 2019-03-01 13:38:51 -08:00 committed by TensorFlower Gardener
parent f8f5dca1cf
commit a56804651a

View File

@ -17,6 +17,14 @@ config_setting(
py_binary( py_binary(
name = "predict", name = "predict",
srcs = ["predict.py"], srcs = ["predict.py"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [":predict_main_lib"],
)
py_library(
name = "predict_main_lib",
srcs = ["predict.py"],
data = ["data/period_trend.csv"], data = ["data/period_trend.csv"],
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
tags = ["no_pip"], tags = ["no_pip"],
@ -40,7 +48,7 @@ py_test(
"notsan", # b/67513579 "notsan", # b/67513579
], ],
deps = [ deps = [
":predict", ":predict_main_lib",
"//tensorflow/python:client_testlib", "//tensorflow/python:client_testlib",
], ],
) )
@ -48,6 +56,14 @@ py_test(
py_binary( py_binary(
name = "known_anomaly", name = "known_anomaly",
srcs = ["known_anomaly.py"], srcs = ["known_anomaly.py"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [":known_anomaly_main_lib"],
)
py_library(
name = "known_anomaly_main_lib",
srcs = ["known_anomaly.py"],
data = ["data/changepoints.csv"], data = ["data/changepoints.csv"],
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
tags = ["no_pip"], tags = ["no_pip"],
@ -66,7 +82,7 @@ py_test(
srcs = ["known_anomaly_test.py"], srcs = ["known_anomaly_test.py"],
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
deps = [ deps = [
":known_anomaly", ":known_anomaly_main_lib",
"//tensorflow/python:client_testlib", "//tensorflow/python:client_testlib",
], ],
) )
@ -74,6 +90,14 @@ py_test(
py_binary( py_binary(
name = "multivariate", name = "multivariate",
srcs = ["multivariate.py"], srcs = ["multivariate.py"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
deps = [":multivariate_main_lib"],
)
py_library(
name = "multivariate_main_lib",
srcs = ["multivariate.py"],
data = ["data/multivariate_level.csv"], data = ["data/multivariate_level.csv"],
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
tags = ["no_pip"], tags = ["no_pip"],
@ -94,7 +118,7 @@ py_test(
], ],
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
deps = [ deps = [
":multivariate", ":multivariate_main_lib",
"//tensorflow/python:client_testlib", "//tensorflow/python:client_testlib",
], ],
) )
@ -102,6 +126,15 @@ py_test(
py_binary( py_binary(
name = "lstm", name = "lstm",
srcs = ["lstm.py"], srcs = ["lstm.py"],
srcs_version = "PY2AND3",
tags = ["no_pip"],
visibility = ["//visibility:public"],
deps = [":lstm_main_lib"],
)
py_library(
name = "lstm_main_lib",
srcs = ["lstm.py"],
data = ["data/multivariate_periods.csv"], data = ["data/multivariate_periods.csv"],
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
tags = ["no_pip"], tags = ["no_pip"],
@ -125,7 +158,7 @@ py_test(
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
tags = ["notsan"], tags = ["notsan"],
deps = [ deps = [
":lstm", ":lstm_main_lib",
"//tensorflow/python:client_testlib", "//tensorflow/python:client_testlib",
"//tensorflow/python/estimator:estimator_py", "//tensorflow/python/estimator:estimator_py",
], ],