• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The gRPC authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load("//bazel:python_rules.bzl", "py_proto_library")
16
17package(default_testonly = 1)
18
19proto_library(
20    name = "simplest_proto",
21    testonly = True,
22    srcs = ["simplest.proto"],
23    strip_import_prefix = "/tools/distrib/python/grpcio_tools/grpc_tools/test/",
24)
25
26proto_library(
27    name = "complicated_proto",
28    testonly = True,
29    srcs = ["complicated.proto"],
30    strip_import_prefix = "/tools/distrib/python/grpcio_tools/grpc_tools/test/",
31    deps = [":simplest_proto"],
32)
33
34py_proto_library(
35    name = "complicated_py_pb2",
36    testonly = True,
37    deps = ["complicated_proto"],
38)
39
40py_test(
41    name = "protoc_test",
42    srcs = ["protoc_test.py"],
43    data = [
44        "complicated.proto",
45        "flawed.proto",
46        "simple.proto",
47        "simpler.proto",
48        "simplest.proto",
49    ],
50    python_version = "PY3",
51    deps = [
52        ":complicated_py_pb2",
53        "//tools/distrib/python/grpcio_tools:grpc_tools",
54    ],
55)
56