Skip to content

Commit d862254

Browse files
committed
[grpcio] Update to 1.82.1
Closes: #15982
1 parent a7bcce8 commit d862254

3 files changed

Lines changed: 56 additions & 7 deletions

File tree

stubs/grpcio/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "1.*"
1+
version = "~= 1.82.1"
22
upstream-repository = "https://github.com/grpc/grpc"
33
partial-stub = true
44

stubs/grpcio/grpc/__init__.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import threading
44
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
55
from concurrent import futures
66
from types import ModuleType, TracebackType
7-
from typing import Any, Generic, NoReturn, Protocol, TypeAlias, TypeVar, type_check_only
7+
from typing import Any, Generic, NoReturn, Protocol, TypeAlias, TypeVar, runtime_checkable, type_check_only
88
from typing_extensions import Self
99

1010
from . import aio as aio
@@ -483,7 +483,8 @@ class RpcMethodHandler(abc.ABC, Generic[_TRequest, _TResponse]):
483483

484484
stream_stream: Callable[[Iterator[_TRequest], ServicerContext], Iterator[_TResponse]] | None
485485

486-
class HandlerCallDetails(abc.ABC):
486+
@runtime_checkable
487+
class HandlerCallDetails(Protocol):
487488
method: str
488489
invocation_metadata: _Metadata
489490

stubs/grpcio/grpc/aio/__init__.pyi

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ from collections.abc import (
1515
)
1616
from concurrent import futures
1717
from types import TracebackType
18-
from typing import Any, Generic, NoReturn, TypeAlias, TypeVar, overload, type_check_only
18+
from typing import Any, Final, Generic, Literal, NoReturn, TypeAlias, TypeVar, overload, type_check_only
1919
from typing_extensions import Self
2020

2121
from grpc import (
@@ -32,9 +32,55 @@ from grpc import (
3232
_Options,
3333
)
3434

35+
__all__ = (
36+
"EOF",
37+
"AbortError",
38+
"AioRpcError",
39+
"BaseError",
40+
"Call",
41+
"Channel",
42+
"ClientCallDetails",
43+
"ClientInterceptor",
44+
"InterceptedUnaryUnaryCall",
45+
"InternalError",
46+
"Metadata",
47+
"RpcContext",
48+
"Server",
49+
"ServerInterceptor",
50+
"ServicerContext",
51+
"StreamStreamCall",
52+
"StreamStreamClientInterceptor",
53+
"StreamStreamMultiCallable",
54+
"StreamUnaryCall",
55+
"StreamUnaryClientInterceptor",
56+
"StreamUnaryMultiCallable",
57+
"UnaryStreamCall",
58+
"UnaryStreamClientInterceptor",
59+
"UnaryStreamMultiCallable",
60+
"UnaryUnaryCall",
61+
"UnaryUnaryClientInterceptor",
62+
"UnaryUnaryMultiCallable",
63+
"UsageError",
64+
"init_grpc_aio",
65+
"insecure_channel",
66+
"secure_channel",
67+
"server",
68+
"shutdown_grpc_aio",
69+
)
70+
3571
_TRequest = TypeVar("_TRequest")
3672
_TResponse = TypeVar("_TResponse")
3773

74+
@type_check_only
75+
class _EOF:
76+
def __bool__(self) -> Literal[False]: ...
77+
def __len__(self) -> Literal[0]: ...
78+
79+
EOF: Final[_EOF]
80+
81+
def init_grpc_aio() -> None: ...
82+
def shutdown_grpc_aio() -> None: ...
83+
3884
# Exceptions:
3985

4086
class BaseError(Exception): ...
@@ -46,16 +92,18 @@ class AioRpcError(RpcError):
4692
def __init__(
4793
self,
4894
code: StatusCode,
49-
initial_metadata: Metadata,
50-
trailing_metadata: Metadata,
95+
initial_metadata: Metadata | None = None,
96+
trailing_metadata: Metadata | None = None,
5197
details: str | None = None,
5298
debug_error_string: str | None = None,
5399
) -> None: ...
54-
def debug_error_string(self) -> str: ...
100+
def code(self) -> StatusCode: ...
101+
def details(self) -> str | None: ...
55102
def initial_metadata(self) -> Metadata | MaybeNone: ...
56103
# AioRpcError returns the async Metadata, overriding the synchronous
57104
# grpc.RpcError.trailing_metadata() -> tuple[_Metadatum, ...].
58105
def trailing_metadata(self) -> Metadata | MaybeNone: ... # type: ignore[override]
106+
def debug_error_string(self) -> str | None: ...
59107

60108
# Create Client:
61109

0 commit comments

Comments
 (0)