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