aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/pip_package/pip_smoke_test.py
diff options
context:
space:
mode:
authorGravatar Jianwei Xie <xiejw@google.com>2018-01-24 11:31:06 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-24 11:35:51 -0800
commitad07a86d75ab06bbcfd6f8f6a24debd9036a52d0 (patch)
tree87041ba0e9c329c3838664345ecc7b5ea1b28787 /tensorflow/tools/pip_package/pip_smoke_test.py
parent7f8e600bfb4ff5973bd1ec178b65538e2446fb69 (diff)
Fixed linter errors.
PiperOrigin-RevId: 183115307
Diffstat (limited to 'tensorflow/tools/pip_package/pip_smoke_test.py')
-rw-r--r--tensorflow/tools/pip_package/pip_smoke_test.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/tensorflow/tools/pip_package/pip_smoke_test.py b/tensorflow/tools/pip_package/pip_smoke_test.py
index 8eee489e2d..38a9007387 100644
--- a/tensorflow/tools/pip_package/pip_smoke_test.py
+++ b/tensorflow/tools/pip_package/pip_smoke_test.py
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
-
"""This pip smoke test verifies dependency files exist in the pip package.
This script runs bazel queries to see what python files are required by the
@@ -26,13 +25,12 @@ from __future__ import print_function
import os
import subprocess
+os.chdir(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../..")))
-os.chdir(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
-
-
-PIP_PACKAGE_QUERY_EXPRESSION = \
- 'deps(//tensorflow/tools/pip_package:build_pip_package)'
+PIP_PACKAGE_QUERY_EXPRESSION = (
+ "deps(//tensorflow/tools/pip_package:build_pip_package)")
+# pylint: disable=g-backslash-continuation
PY_TEST_QUERY_EXPRESSION = 'deps(\
filter("^((?!benchmark).)*$",\
kind(py_test,\
@@ -40,6 +38,7 @@ PY_TEST_QUERY_EXPRESSION = 'deps(\
+ //tensorflow/contrib/... \
- //tensorflow/contrib/tensorboard/... \
- attr(tags, "manual|no_pip", //tensorflow/...))), 1)'
+# pylint: enable=g-backslash-continuation
# Hard-coded blacklist of files if not included in pip package
# TODO(amitpatankar): Clean up blacklist.
@@ -90,15 +89,15 @@ def main():
"""
# pip_package_dependencies_list is the list of included files in pip packages
- pip_package_dependencies = subprocess.check_output([
- 'bazel', 'query', PIP_PACKAGE_QUERY_EXPRESSION])
+ pip_package_dependencies = subprocess.check_output(
+ ["bazel", "query", PIP_PACKAGE_QUERY_EXPRESSION])
pip_package_dependencies_list = pip_package_dependencies.strip().split("\n")
print("Pip package superset size: %d" % len(pip_package_dependencies_list))
# tf_py_test_dependencies is the list of dependencies for all python
# tests in tensorflow
- tf_py_test_dependencies = subprocess.check_output([
- 'bazel', 'query', PY_TEST_QUERY_EXPRESSION])
+ tf_py_test_dependencies = subprocess.check_output(
+ ["bazel", "query", PY_TEST_QUERY_EXPRESSION])
tf_py_test_dependencies_list = tf_py_test_dependencies.strip().split("\n")
print("Pytest dependency subset size: %d" % len(tf_py_test_dependencies_list))
@@ -119,8 +118,7 @@ def main():
# Check if the dependency is in the pip package, the blacklist, or
# should be ignored because of its file extension
- if not (ignore or
- dependency in pip_package_dependencies_list or
+ if not (ignore or dependency in pip_package_dependencies_list or
dependency in BLACKLIST):
missing_dependencies.append(dependency)
@@ -131,9 +129,9 @@ def main():
for missing_dependency in missing_dependencies:
print("\nMissing dependency: %s " % missing_dependency)
print("Affected Tests:")
- rdep_query = 'rdeps(kind(py_test, \
- //tensorflow/python/...), %s)' % missing_dependency
- affected_tests = subprocess.check_output(['bazel', 'query', rdep_query])
+ rdep_query = ("rdeps(kind(py_test, //tensorflow/python/...), %s)" %
+ missing_dependency)
+ affected_tests = subprocess.check_output(["bazel", "query", rdep_query])
affected_tests_list = affected_tests.split("\n")[:-2]
print("\n".join(affected_tests_list))
@@ -145,5 +143,6 @@ or add them to //tensorflow/tools/pip_package/BUILD.""")
else:
print("TEST PASSED")
+
if __name__ == "__main__":
main()