| licenses(["notice"]) |
| |
| py_library( |
| name = "app", |
| srcs = [ |
| "app.py", |
| ], |
| srcs_version = "PY2AND3", |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":command_name", |
| "//absl/flags", |
| "//absl/logging", |
| ], |
| ) |
| |
| py_library( |
| name = "command_name", |
| srcs = ["command_name.py"], |
| srcs_version = "PY2AND3", |
| visibility = ["//visibility:public"], |
| ) |
| |
| # NOTE: Because of how Bazel's Python support works, its possible (quite likely, |
| # actually) to be running Python 3 without this config setting being matched, |
| # so be careful about assuming or requiring it to match for a target to |
| # correctly work under Python 3. |
| # See: https://github.com/bazelbuild/bazel/issues/4815 |
| config_setting( |
| name = "py3_mode", |
| flag_values = {"@bazel_tools//tools/python:python_version": "PY3"}, |
| visibility = [":__subpackages__"], |
| ) |
| |
| config_setting( |
| name = "py2_mode", |
| flag_values = {"@bazel_tools//tools/python:python_version": "PY2"}, |
| visibility = [":__subpackages__"], |
| ) |
| |
| py_library( |
| name = "_collections_abc", |
| srcs = ["_collections_abc.py"], |
| visibility = [":__subpackages__"], |
| deps = ["@six_archive//:six"], |
| ) |
| |
| py_library( |
| name = "tests/app_test_helper", |
| testonly = 1, |
| srcs = ["tests/app_test_helper.py"], |
| srcs_version = "PY2AND3", |
| deps = [ |
| ":app", |
| "//absl/flags", |
| ], |
| ) |
| |
| py_binary( |
| name = "tests/app_test_helper_pure_python", |
| testonly = 1, |
| srcs = ["tests/app_test_helper.py"], |
| main = "tests/app_test_helper.py", |
| python_version = "PY3", |
| srcs_version = "PY3", |
| deps = [ |
| ":app", |
| "//absl/flags", |
| ], |
| ) |
| |
| py_test( |
| name = "tests/app_test", |
| srcs = ["tests/app_test.py"], |
| data = [":tests/app_test_helper_pure_python"], |
| python_version = "PY3", |
| srcs_version = "PY3", |
| deps = [ |
| ":app", |
| ":tests/app_test_helper", |
| "//absl/flags", |
| "//absl/testing:_bazelize_command", |
| "//absl/testing:absltest", |
| "//absl/testing:flagsaver", |
| "@mock_archive//:mock", |
| "@six_archive//:six", |
| ], |
| ) |
| |
| py_test( |
| name = "tests/command_name_test", |
| srcs = ["tests/command_name_test.py"], |
| python_version = "PY3", |
| srcs_version = "PY3", |
| deps = [ |
| ":command_name", |
| "//absl/testing:absltest", |
| "@mock_archive//:mock", |
| ], |
| ) |
| |
| py_test( |
| name = "tests/python_version_test", |
| srcs = ["tests/python_version_test.py"], |
| python_version = "PY3", |
| srcs_version = "PY3", |
| deps = [ |
| "//absl/flags", |
| "//absl/testing:absltest", |
| ], |
| ) |