grpcio-fips 1.44.0__4-cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. grpc/__init__.py +2190 -0
  2. grpc/_auth.py +58 -0
  3. grpc/_channel.py +1581 -0
  4. grpc/_common.py +168 -0
  5. grpc/_compression.py +55 -0
  6. grpc/_cython/__init__.py +13 -0
  7. grpc/_cython/_credentials/roots.pem +4337 -0
  8. grpc/_cython/_cygrpc/__init__.py +13 -0
  9. grpc/_cython/ayx-crypto-library.dll +0 -0
  10. grpc/_cython/cygrpc.cp310-win_amd64.pyd +0 -0
  11. grpc/_cython/libcrypto-3-x64.dll +0 -0
  12. grpc/_cython/libssl-3-x64.dll +0 -0
  13. grpc/_grpcio_metadata.py +1 -0
  14. grpc/_interceptor.py +562 -0
  15. grpc/_plugin_wrapping.py +113 -0
  16. grpc/_runtime_protos.py +155 -0
  17. grpc/_server.py +1003 -0
  18. grpc/_simple_stubs.py +486 -0
  19. grpc/_utilities.py +168 -0
  20. grpc/aio/__init__.py +95 -0
  21. grpc/aio/_base_call.py +248 -0
  22. grpc/aio/_base_channel.py +352 -0
  23. grpc/aio/_base_server.py +373 -0
  24. grpc/aio/_call.py +648 -0
  25. grpc/aio/_channel.py +484 -0
  26. grpc/aio/_interceptor.py +1004 -0
  27. grpc/aio/_metadata.py +120 -0
  28. grpc/aio/_server.py +210 -0
  29. grpc/aio/_typing.py +35 -0
  30. grpc/aio/_utils.py +22 -0
  31. grpc/beta/__init__.py +13 -0
  32. grpc/beta/_client_adaptations.py +706 -0
  33. grpc/beta/_metadata.py +52 -0
  34. grpc/beta/_server_adaptations.py +385 -0
  35. grpc/beta/implementations.py +311 -0
  36. grpc/beta/interfaces.py +164 -0
  37. grpc/beta/utilities.py +149 -0
  38. grpc/experimental/__init__.py +128 -0
  39. grpc/experimental/aio/__init__.py +16 -0
  40. grpc/experimental/gevent.py +27 -0
  41. grpc/experimental/session_cache.py +45 -0
  42. grpc/framework/__init__.py +13 -0
  43. grpc/framework/common/__init__.py +13 -0
  44. grpc/framework/common/cardinality.py +26 -0
  45. grpc/framework/common/style.py +24 -0
  46. grpc/framework/foundation/__init__.py +13 -0
  47. grpc/framework/foundation/abandonment.py +22 -0
  48. grpc/framework/foundation/callable_util.py +96 -0
  49. grpc/framework/foundation/future.py +221 -0
  50. grpc/framework/foundation/logging_pool.py +71 -0
  51. grpc/framework/foundation/stream.py +45 -0
  52. grpc/framework/foundation/stream_util.py +148 -0
  53. grpc/framework/interfaces/__init__.py +13 -0
  54. grpc/framework/interfaces/base/__init__.py +13 -0
  55. grpc/framework/interfaces/base/base.py +327 -0
  56. grpc/framework/interfaces/base/utilities.py +71 -0
  57. grpc/framework/interfaces/face/__init__.py +13 -0
  58. grpc/framework/interfaces/face/face.py +1050 -0
  59. grpc/framework/interfaces/face/utilities.py +168 -0
  60. grpcio_fips-1.44.0.dist-info/LICENSE +242 -0
  61. grpcio_fips-1.44.0.dist-info/METADATA +141 -0
  62. grpcio_fips-1.44.0.dist-info/RECORD +64 -0
  63. grpcio_fips-1.44.0.dist-info/WHEEL +5 -0
  64. grpcio_fips-1.44.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,155 @@
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
+
15
+ import sys
16
+
17
+ _REQUIRED_SYMBOLS = ("_protos", "_services", "_protos_and_services")
18
+ _MINIMUM_VERSION = (3, 5, 0)
19
+
20
+ _UNINSTALLED_TEMPLATE = "Install the grpcio-tools package (1.32.0+) to use the {} function."
21
+ _VERSION_ERROR_TEMPLATE = "The {} function is only on available on Python 3.X interpreters."
22
+
23
+
24
+ def _has_runtime_proto_symbols(mod):
25
+ return all(hasattr(mod, sym) for sym in _REQUIRED_SYMBOLS)
26
+
27
+
28
+ def _is_grpc_tools_importable():
29
+ try:
30
+ import grpc_tools # pylint: disable=unused-import
31
+ return True
32
+ except ImportError as e:
33
+ # NOTE: It's possible that we're encountering a transitive ImportError, so
34
+ # we check for that and re-raise if so.
35
+ if "grpc_tools" not in e.args[0]:
36
+ raise
37
+ return False
38
+
39
+
40
+ def _call_with_lazy_import(fn_name, protobuf_path):
41
+ """Calls one of the three functions, lazily importing grpc_tools.
42
+
43
+ Args:
44
+ fn_name: The name of the function to import from grpc_tools.protoc.
45
+ protobuf_path: The path to import.
46
+
47
+ Returns:
48
+ The appropriate module object.
49
+ """
50
+ if sys.version_info < _MINIMUM_VERSION:
51
+ raise NotImplementedError(_VERSION_ERROR_TEMPLATE.format(fn_name))
52
+ else:
53
+ if not _is_grpc_tools_importable():
54
+ raise NotImplementedError(_UNINSTALLED_TEMPLATE.format(fn_name))
55
+ import grpc_tools.protoc
56
+ if _has_runtime_proto_symbols(grpc_tools.protoc):
57
+ fn = getattr(grpc_tools.protoc, '_' + fn_name)
58
+ return fn(protobuf_path)
59
+ else:
60
+ raise NotImplementedError(_UNINSTALLED_TEMPLATE.format(fn_name))
61
+
62
+
63
+ def protos(protobuf_path): # pylint: disable=unused-argument
64
+ """Returns a module generated by the indicated .proto file.
65
+
66
+ THIS IS AN EXPERIMENTAL API.
67
+
68
+ Use this function to retrieve classes corresponding to message
69
+ definitions in the .proto file.
70
+
71
+ To inspect the contents of the returned module, use the dir function.
72
+ For example:
73
+
74
+ ```
75
+ protos = grpc.protos("foo.proto")
76
+ print(dir(protos))
77
+ ```
78
+
79
+ The returned module object corresponds to the _pb2.py file generated
80
+ by protoc. The path is expected to be relative to an entry on sys.path
81
+ and all transitive dependencies of the file should also be resolveable
82
+ from an entry on sys.path.
83
+
84
+ To completely disable the machinery behind this function, set the
85
+ GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
86
+
87
+ Args:
88
+ protobuf_path: The path to the .proto file on the filesystem. This path
89
+ must be resolveable from an entry on sys.path and so must all of its
90
+ transitive dependencies.
91
+
92
+ Returns:
93
+ A module object corresponding to the message code for the indicated
94
+ .proto file. Equivalent to a generated _pb2.py file.
95
+ """
96
+ return _call_with_lazy_import("protos", protobuf_path)
97
+
98
+
99
+ def services(protobuf_path): # pylint: disable=unused-argument
100
+ """Returns a module generated by the indicated .proto file.
101
+
102
+ THIS IS AN EXPERIMENTAL API.
103
+
104
+ Use this function to retrieve classes and functions corresponding to
105
+ service definitions in the .proto file, including both stub and servicer
106
+ definitions.
107
+
108
+ To inspect the contents of the returned module, use the dir function.
109
+ For example:
110
+
111
+ ```
112
+ services = grpc.services("foo.proto")
113
+ print(dir(services))
114
+ ```
115
+
116
+ The returned module object corresponds to the _pb2_grpc.py file generated
117
+ by protoc. The path is expected to be relative to an entry on sys.path
118
+ and all transitive dependencies of the file should also be resolveable
119
+ from an entry on sys.path.
120
+
121
+ To completely disable the machinery behind this function, set the
122
+ GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
123
+
124
+ Args:
125
+ protobuf_path: The path to the .proto file on the filesystem. This path
126
+ must be resolveable from an entry on sys.path and so must all of its
127
+ transitive dependencies.
128
+
129
+ Returns:
130
+ A module object corresponding to the stub/service code for the indicated
131
+ .proto file. Equivalent to a generated _pb2_grpc.py file.
132
+ """
133
+ return _call_with_lazy_import("services", protobuf_path)
134
+
135
+
136
+ def protos_and_services(protobuf_path): # pylint: disable=unused-argument
137
+ """Returns a 2-tuple of modules corresponding to protos and services.
138
+
139
+ THIS IS AN EXPERIMENTAL API.
140
+
141
+ The return value of this function is equivalent to a call to protos and a
142
+ call to services.
143
+
144
+ To completely disable the machinery behind this function, set the
145
+ GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
146
+
147
+ Args:
148
+ protobuf_path: The path to the .proto file on the filesystem. This path
149
+ must be resolveable from an entry on sys.path and so must all of its
150
+ transitive dependencies.
151
+
152
+ Returns:
153
+ A 2-tuple of module objects corresponding to (protos(path), services(path)).
154
+ """
155
+ return _call_with_lazy_import("protos_and_services", protobuf_path)