Skip to content

Commit

Permalink
Merge branch 'master' of github.com:shabbyrobe/grpc-stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
shabbyrobe committed Sep 29, 2023
2 parents ca87563 + 41edee8 commit 94f7aee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions grpc-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ class ServerInterceptor(typing.Generic[TRequest, TResponse]):
typing.Optional[RpcMethodHandler[TRequest, TResponse]]
],
handler_call_details: HandlerCallDetails,
) -> RpcMethodHandler[TRequest, TResponse]:
) -> typing.Optional[RpcMethodHandler[TRequest, TResponse]]:
...


Expand All @@ -626,7 +626,7 @@ class UnaryUnaryMultiCallable(typing.Generic[TRequest, TResponse]):
def __call__(
self,
request: TRequest,
timeout: typing.Optional[int] = None,
timeout: typing.Optional[float] = None,
metadata: typing.Optional[Metadata] = None,
credentials: typing.Optional[CallCredentials] = None,

Expand Down
2 changes: 1 addition & 1 deletion grpc-stubs/aio/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class UnaryUnaryMultiCallable(typing.Generic[TRequest, TResponse]):
def __call__(
self,
request: TRequest,
timeout: typing.Optional[int] = None,
timeout: typing.Optional[float] = None,
metadata: typing.Optional[MetadataType] = None,
credentials: typing.Optional[CallCredentials] = None,
# FIXME: optional bool seems weird, but that's what the docs suggest
Expand Down
2 changes: 1 addition & 1 deletion grpc_reflection-stubs/v1alpha/reflection.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ReflectionServicer(BaseReflectionServicer):
...

def enable_server_reflection(
service_names: typing.List[str],
service_names: typing.Iterable[str],
server: AnyServer,
pool: typing.Optional[descriptor_pool.DescriptorPool] = ...,
) -> None:
Expand Down
12 changes: 12 additions & 0 deletions typesafety/test_grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,15 @@
server = typing.cast(aio.Server, None)
enable_server_reflection(["foo"], server, None)
- case: server_interceptor
main: |
import typing
import grpc
class NoopInterceptor(grpc.ServerInterceptor):
def intercept_service(
self,
continuation: typing.Callable[[grpc.HandlerCallDetails], typing.Optional[grpc.RpcMethodHandler]],
handler_call_details: grpc.HandlerCallDetails,
) -> typing.Optional[grpc.RpcMethodHandler]:
return continuation(handler_call_details)

0 comments on commit 94f7aee

Please sign in to comment.