github.com/sercand/please@v13.4.0+incompatible/test/python_rules/BUILD (about)

     1  # Test for a panic provoked by a python_library using a proto_library as a resource.
     2  proto_library(
     3      name = "test_proto",
     4      srcs = ["test.proto"],
     5      languages = ["py"],
     6  )
     7  
     8  python_library(
     9      name = "proto_lib",
    10      srcs = ["proto_lib.py"],
    11      resources = [":test_proto"],
    12  )
    13  
    14  python_test(
    15      name = "proto_test",
    16      srcs = ["proto_test.py"],
    17      deps = [":proto_lib"],
    18  )
    19  
    20  python_binary(
    21      name = "strip_source",
    22      main = "strip_source.py",
    23      strip = True,
    24  )
    25  
    26  python_test(
    27      name = "strip_source_test",
    28      srcs = ["strip_source_test.py"],
    29      data = [":strip_source"],
    30      labels = ["py3"],
    31  )
    32  
    33  # Test that has no actual tests in it. Should still count as a pass.
    34  python_test(
    35      name = "empty_test",
    36      srcs = ["empty_test.py"],
    37  )
    38  
    39  # Test that the build rules accept a python_binary that has a rule as the main.
    40  filegroup(
    41      name = "rule_main",
    42      srcs = ["rule_main.py"],
    43  )
    44  
    45  python_binary(
    46      name = "rule_main_pex",
    47      main = ":rule_main",
    48  )
    49  
    50  sh_test(
    51      name = "rule_main_test",
    52      src = "rule_main_test.sh",
    53      data = [":rule_main_pex"],
    54      labels = ["python3"],
    55  )
    56  
    57  # Used to test zip-safety flags.
    58  python_test(
    59      name = "zip_unsafe_test",
    60      srcs = ["zip_unsafe_test.py"],
    61      labels = [
    62          "cc",  # Depends on cc rules to build
    63          "py3_pkg_config",  # and pkg-config python3
    64      ],
    65      deps = [
    66          "//test/cc_rules/gcc:so_test_py",
    67      ],
    68  )
    69  
    70  # Test flags on python_test
    71  python_test(
    72      name = "flags_test",
    73      srcs = ["flags_test.py"],
    74      flags = "--test_flag",
    75  )
    76  
    77  # Tests for a subtle case where python_test rules should get a pex when
    78  # specified as data, but not when depending directly.
    79  python_binary(
    80      name = "data_dep",
    81      main = "data_dep.py",
    82  )
    83  
    84  python_test(
    85      name = "data_dep_test",
    86      srcs = ["data_dep_test.py"],
    87      data = [":data_dep"],
    88      deps = [":data_dep"],
    89  )
    90  
    91  python_test(
    92      name = "data_dep_only_test",
    93      srcs = ["data_dep_only_test.py"],
    94      data = [":data_dep"],
    95  )
    96  
    97  python_test(
    98      name = "python2_coverage_test",
    99      srcs = ["python_coverage_test.py"],
   100      interpreter = "python2",
   101      labels = ["py2"],
   102  )
   103  
   104  python_test(
   105      name = "python3_coverage_test",
   106      srcs = ["python_coverage_test.py"],
   107      labels = ["py3"],
   108  )
   109  
   110  python_test(
   111      name = "unittest_unicode_test",
   112      srcs = ["unittest_unicode_test.py"],
   113  )
   114  
   115  python_test(
   116      name = "numpy_test",
   117      srcs = ["numpy_test.py"],
   118      labels = [
   119          "py3",
   120          "pip",
   121      ],
   122      deps = ["//third_party/python:numpy"],
   123  )
   124  
   125  python_test(
   126      name = "tensorflow_test",
   127      srcs = ["tensorflow_test.py"],
   128      labels = [
   129          "py3",
   130          "pip",
   131      ],
   132      deps = ["//third_party/python:tensorflow"],
   133  )
   134  
   135  python_test(
   136      name = "pandas_test",
   137      srcs = ["pandas_test.py"],
   138      labels = [
   139          "py3",
   140          "pip",
   141      ],
   142      deps = ["//third_party/python:pandas"],
   143  )
   144  
   145  python_test(
   146      name = "scipy_test",
   147      srcs = ["scipy_test.py"],
   148      labels = [
   149          "py3",
   150          "pip",
   151      ],
   152      deps = ["//third_party/python:scipy"],
   153  )
   154  
   155  python_test(
   156      name = "worker_test",
   157      srcs = ["worker_test.py"],
   158      worker = "//test/workers:worker",
   159  )