1# Copyright 2021 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. 14load("@grpc_python_dependencies//:requirements.bzl", "requirement") 15 16package(default_visibility = ["//visibility:public"]) 17 18py_library( 19 name = "_intraop_test_case", 20 srcs = ["_intraop_test_case.py"], 21 imports = ["../../"], 22 deps = [ 23 ":methods", 24 ], 25) 26 27py_library( 28 name = "client_lib", 29 srcs = ["client.py"], 30 imports = ["../../"], 31 deps = [ 32 ":methods", 33 ":resources", 34 "//src/proto/grpc/testing:py_test_proto", 35 "//src/python/grpcio/grpc:grpcio", 36 requirement("absl-py"), 37 requirement("google-auth"), 38 ], 39) 40 41py_binary( 42 name = "client", 43 srcs = ["client.py"], 44 python_version = "PY3", 45 deps = [":client_lib"], 46) 47 48py_library( 49 name = "methods", 50 srcs = ["methods.py"], 51 imports = ["../../"], 52 deps = [ 53 "//src/proto/grpc/testing:empty_py_pb2", 54 "//src/proto/grpc/testing:py_messages_proto", 55 "//src/proto/grpc/testing:py_test_proto", 56 "//src/proto/grpc/testing:test_py_pb2_grpc", 57 "//src/python/grpcio/grpc:grpcio", 58 "//src/python/grpcio_tests/tests:bazel_namespace_package_hack", 59 requirement("google-auth"), 60 requirement("requests"), 61 requirement("urllib3"), 62 requirement("chardet"), 63 requirement("certifi"), 64 requirement("idna"), 65 ], 66) 67 68py_library( 69 name = "resources", 70 srcs = ["resources.py"], 71 data = [ 72 "//src/python/grpcio_tests/tests/interop/credentials", 73 ], 74) 75 76py_library( 77 name = "service", 78 srcs = ["service.py"], 79 imports = ["../../"], 80 deps = [ 81 "//src/proto/grpc/testing:empty_py_pb2", 82 "//src/proto/grpc/testing:py_messages_proto", 83 "//src/proto/grpc/testing:py_test_proto", 84 "//src/python/grpcio/grpc:grpcio", 85 ], 86) 87 88py_library( 89 name = "server", 90 srcs = ["server.py"], 91 imports = ["../../"], 92 deps = [ 93 ":resources", 94 ":service", 95 "//src/proto/grpc/testing:py_test_proto", 96 "//src/python/grpcio/grpc:grpcio", 97 "//src/python/grpcio_tests/tests/unit:test_common", 98 requirement("absl-py"), 99 ], 100) 101 102py_binary( 103 name = "server_bin", 104 srcs = ["server.py"], 105 main = "server.py", 106 python_version = "PY3", 107 deps = [ 108 ":server", 109 ":service", 110 "//src/proto/grpc/testing:test_py_pb2_grpc", 111 ], 112) 113 114py_test( 115 name = "_insecure_intraop_test", 116 size = "small", 117 srcs = ["_insecure_intraop_test.py"], 118 data = [ 119 "//src/python/grpcio_tests/tests/unit/credentials", 120 ], 121 imports = ["../../"], 122 main = "_insecure_intraop_test.py", 123 python_version = "PY3", 124 deps = [ 125 ":_intraop_test_case", 126 ":server", 127 ":service", 128 "//src/proto/grpc/testing:py_test_proto", 129 "//src/python/grpcio/grpc:grpcio", 130 "//src/python/grpcio_tests/tests/unit:test_common", 131 ], 132) 133 134py_test( 135 name = "_secure_intraop_test", 136 size = "small", 137 srcs = ["_secure_intraop_test.py"], 138 imports = ["../../"], 139 main = "_secure_intraop_test.py", 140 python_version = "PY3", 141 deps = [ 142 ":_intraop_test_case", 143 ":server", 144 ":service", 145 "//src/proto/grpc/testing:py_test_proto", 146 "//src/python/grpcio/grpc:grpcio", 147 "//src/python/grpcio_tests/tests/unit:test_common", 148 ], 149) 150