1# Description: 2# Tools for building the TensorFlow pip package. 3 4load("@local_config_syslibs//:build_defs.bzl", "if_not_system_lib") 5 6package(default_visibility = ["//visibility:private"]) 7 8COMMON_PIP_DEPS = [ 9 ":licenses", 10 "MANIFEST.in", 11 "README", 12 "setup.py", 13 "//tensorflow_lite_support/codegen/python:codegen", 14 "//tensorflow_lite_support/metadata/python:metadata", 15] 16 17filegroup( 18 name = "licenses", 19 data = [ 20 "//:LICENSE", 21 "@org_tensorflow//:LICENSE", 22 ] + if_not_system_lib( 23 "absl_py", 24 [ 25 "@absl_py//absl:LICENSE", 26 "@absl_py//absl/logging:LICENSE", 27 "@absl_py//absl/flags:LICENSE", 28 "@absl_py//absl/testing:LICENSE", 29 "@absl_py//absl/third_party/unittest3_backport:LICENSE", 30 ], 31 ), 32) 33 34sh_binary( 35 name = "build_pip_package", 36 srcs = ["build_pip_package.sh"], 37 data = COMMON_PIP_DEPS + 38 select({ 39 "@org_tensorflow//tensorflow:windows": [ 40 ":simple_console_for_windows", 41 ], 42 "//conditions:default": [ 43 ], 44 }), 45) 46 47# On Windows, python binary is a zip file of runfiles tree. 48# Add everything to its data dependency for generating a runfiles tree 49# for building the pip package on Windows. 50py_binary( 51 name = "simple_console_for_windows", 52 srcs = ["simple_console_for_windows.py"], 53 data = COMMON_PIP_DEPS, 54 srcs_version = "PY2AND3", 55) 56