From 05554dc2c61ebb6bab21b8cf87131d6b8d651c05 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 16:50:52 -0400 Subject: [PATCH 01/17] Remove Any in stubs/grpcio/grpc_status/rpc_status.pyi --- stubs/grpcio/grpc_status/rpc_status.pyi | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/stubs/grpcio/grpc_status/rpc_status.pyi b/stubs/grpcio/grpc_status/rpc_status.pyi index abf6b8761f3c..090716d5cfe9 100644 --- a/stubs/grpcio/grpc_status/rpc_status.pyi +++ b/stubs/grpcio/grpc_status/rpc_status.pyi @@ -1,13 +1,7 @@ -from typing import Any - import grpc -# XXX: don't yet know how to add a stub for google.rpc.status_pb2.Status -# without affecting other stuff; may need to make a stub-only package for -# google.rpc as well. - # Returns a google.rpc.status.Status message corresponding to a given grpc.Call. -def from_call(call: grpc.Call) -> Any: ... +def from_call(call: grpc.Call): ... # Convert a google.rpc.status.Status message to grpc.Status. -def to_status(status: Any) -> grpc.Status: ... +def to_status(status) -> grpc.Status: ... From 3b36a980d39425275e3d436eb9e8e547947e76f4 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 17:46:47 -0400 Subject: [PATCH 02/17] Extract and complete grpcio plugins --- stubs/grpcio-channelz/METADATA.toml | 3 + .../grpc_channelz/__init__.pyi | 0 .../grpc_channelz/v1/__init__.pyi | 0 .../grpc_channelz/v1/_async.pyi | 19 + .../grpc_channelz/v1/_servicer.pyi | 0 .../grpc_channelz/v1/channelz.pyi | 6 + .../grpc_channelz/v1/channelz_pb2.pyi | 450 ++++++++++++++++++ .../grpc_channelz/v1/channelz_pb2_grpc.pyi | 121 +++++ stubs/grpcio-health-checking/METADATA.toml | 3 + .../grpc_health/__init__.pyi | 0 .../grpc_health/v1/__init__.pyi | 0 .../grpc_health/v1/health.pyi | 37 ++ .../grpc_health/v1/health_pb2.pyi | 28 ++ .../grpc_health/v1/health_pb2_grpc.pyi | 43 ++ .../@tests/test_cases/check_reflection.py | 0 .../@tests/test_cases/check_reflection_aio.py | 0 stubs/grpcio-reflection/METADATA.toml | 3 + .../grpc_reflection/__init__.pyi | 0 .../grpc_reflection/v1alpha/__init__.pyi | 0 .../grpc_reflection/v1alpha/_async.pyi | 11 + .../grpc_reflection/v1alpha/_base.pyi | 6 + .../grpc_reflection/v1alpha/reflection.pyi | 17 +- .../v1alpha/reflection_pb2.pyi | 81 ++++ .../v1alpha/reflection_pb2_grpc.pyi | 31 ++ .../@tests/test_cases/check_status.py | 0 stubs/grpcio-status/METADATA.toml | 2 + stubs/grpcio-status/grpc_status/__init__.pyi | 0 .../grpc_status/rpc_status.pyi | 0 stubs/grpcio/@tests/stubtest_allowlist.txt | 5 - stubs/grpcio/METADATA.toml | 9 - stubs/grpcio/grpc_channelz/__init__.pyi | 3 - stubs/grpcio/grpc_channelz/v1/__init__.pyi | 3 - stubs/grpcio/grpc_channelz/v1/channelz.pyi | 3 - .../grpcio/grpc_channelz/v1/channelz_pb2.pyi | 16 - .../grpc_channelz/v1/channelz_pb2_grpc.pyi | 3 - stubs/grpcio/grpc_health/__init__.pyi | 3 - stubs/grpcio/grpc_health/v1/__init__.pyi | 3 - stubs/grpcio/grpc_health/v1/health.pyi | 34 -- stubs/grpcio/grpc_health/v1/health_pb2.pyi | 3 - .../grpcio/grpc_health/v1/health_pb2_grpc.pyi | 6 - stubs/grpcio/grpc_reflection/__init__.pyi | 3 - .../grpc_reflection/v1alpha/__init__.pyi | 3 - .../grpcio/grpc_reflection/v1alpha/_base.pyi | 6 - .../v1alpha/reflection_pb2.pyi | 3 - stubs/grpcio/grpc_status/__init__.pyi | 3 - 45 files changed, 855 insertions(+), 115 deletions(-) create mode 100644 stubs/grpcio-channelz/METADATA.toml create mode 100644 stubs/grpcio-channelz/grpc_channelz/__init__.pyi create mode 100644 stubs/grpcio-channelz/grpc_channelz/v1/__init__.pyi create mode 100644 stubs/grpcio-channelz/grpc_channelz/v1/_async.pyi rename stubs/{grpcio => grpcio-channelz}/grpc_channelz/v1/_servicer.pyi (100%) create mode 100644 stubs/grpcio-channelz/grpc_channelz/v1/channelz.pyi create mode 100644 stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi create mode 100644 stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi create mode 100644 stubs/grpcio-health-checking/METADATA.toml create mode 100644 stubs/grpcio-health-checking/grpc_health/__init__.pyi create mode 100644 stubs/grpcio-health-checking/grpc_health/v1/__init__.pyi create mode 100644 stubs/grpcio-health-checking/grpc_health/v1/health.pyi create mode 100644 stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi create mode 100644 stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi rename stubs/{grpcio => grpcio-reflection}/@tests/test_cases/check_reflection.py (100%) rename stubs/{grpcio => grpcio-reflection}/@tests/test_cases/check_reflection_aio.py (100%) create mode 100644 stubs/grpcio-reflection/METADATA.toml create mode 100644 stubs/grpcio-reflection/grpc_reflection/__init__.pyi create mode 100644 stubs/grpcio-reflection/grpc_reflection/v1alpha/__init__.pyi create mode 100644 stubs/grpcio-reflection/grpc_reflection/v1alpha/_async.pyi create mode 100644 stubs/grpcio-reflection/grpc_reflection/v1alpha/_base.pyi rename stubs/{grpcio => grpcio-reflection}/grpc_reflection/v1alpha/reflection.pyi (60%) create mode 100644 stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi create mode 100644 stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi rename stubs/{grpcio => grpcio-status}/@tests/test_cases/check_status.py (100%) create mode 100644 stubs/grpcio-status/METADATA.toml create mode 100644 stubs/grpcio-status/grpc_status/__init__.pyi rename stubs/{grpcio => grpcio-status}/grpc_status/rpc_status.pyi (100%) delete mode 100644 stubs/grpcio/grpc_channelz/__init__.pyi delete mode 100644 stubs/grpcio/grpc_channelz/v1/__init__.pyi delete mode 100644 stubs/grpcio/grpc_channelz/v1/channelz.pyi delete mode 100644 stubs/grpcio/grpc_channelz/v1/channelz_pb2.pyi delete mode 100644 stubs/grpcio/grpc_channelz/v1/channelz_pb2_grpc.pyi delete mode 100644 stubs/grpcio/grpc_health/__init__.pyi delete mode 100644 stubs/grpcio/grpc_health/v1/__init__.pyi delete mode 100644 stubs/grpcio/grpc_health/v1/health.pyi delete mode 100644 stubs/grpcio/grpc_health/v1/health_pb2.pyi delete mode 100644 stubs/grpcio/grpc_health/v1/health_pb2_grpc.pyi delete mode 100644 stubs/grpcio/grpc_reflection/__init__.pyi delete mode 100644 stubs/grpcio/grpc_reflection/v1alpha/__init__.pyi delete mode 100644 stubs/grpcio/grpc_reflection/v1alpha/_base.pyi delete mode 100644 stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2.pyi delete mode 100644 stubs/grpcio/grpc_status/__init__.pyi diff --git a/stubs/grpcio-channelz/METADATA.toml b/stubs/grpcio-channelz/METADATA.toml new file mode 100644 index 000000000000..bac12ed6b8d8 --- /dev/null +++ b/stubs/grpcio-channelz/METADATA.toml @@ -0,0 +1,3 @@ +version = "1.*" +upstream_repository = "https://github.com/grpc/grpc" +requires = ["types-grpcio", "types-protobuf"] diff --git a/stubs/grpcio-channelz/grpc_channelz/__init__.pyi b/stubs/grpcio-channelz/grpc_channelz/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/__init__.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/_async.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/_async.pyi new file mode 100644 index 000000000000..87aa2bf125d1 --- /dev/null +++ b/stubs/grpcio-channelz/grpc_channelz/v1/_async.pyi @@ -0,0 +1,19 @@ +from grpc_channelz.v1 import channelz_pb2, channelz_pb2_grpc + +class ChannelzServicer(channelz_pb2_grpc.ChannelzServicer): + @staticmethod + async def GetTopChannels(request: channelz_pb2.GetTopChannelsRequest, context) -> channelz_pb2.GetTopChannelsResponse: ... + @staticmethod + async def GetServers(request: channelz_pb2.GetServersRequest, context) -> channelz_pb2.GetServersResponse: ... + @staticmethod + async def GetServer(request: channelz_pb2.GetServerRequest, context) -> channelz_pb2.GetServerResponse: ... + @staticmethod + async def GetServerSockets( + request: channelz_pb2.GetServerSocketsRequest, context + ) -> channelz_pb2.GetServerSocketsResponse: ... + @staticmethod + async def GetChannel(request: channelz_pb2.GetChannelRequest, context) -> channelz_pb2.GetChannelResponse: ... + @staticmethod + async def GetSubchannel(request: channelz_pb2.GetSubchannelRequest, context) -> channelz_pb2.GetSubchannelResponse: ... + @staticmethod + async def GetSocket(request: channelz_pb2.GetSocketRequest, context) -> channelz_pb2.GetSocketResponse: ... diff --git a/stubs/grpcio/grpc_channelz/v1/_servicer.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/_servicer.pyi similarity index 100% rename from stubs/grpcio/grpc_channelz/v1/_servicer.pyi rename to stubs/grpcio-channelz/grpc_channelz/v1/_servicer.pyi diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz.pyi new file mode 100644 index 000000000000..2ed61fd4fa3a --- /dev/null +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz.pyi @@ -0,0 +1,6 @@ +from grpc_channelz.v1 import _async as aio +from grpc_channelz.v1._servicer import ChannelzServicer + +def add_channelz_servicer(server) -> None: ... + +__all__ = ["aio", "add_channelz_servicer", "ChannelzServicer"] diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi new file mode 100644 index 000000000000..b453522aae9c --- /dev/null +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi @@ -0,0 +1,450 @@ +from collections.abc import Iterable, Mapping +from typing import ClassVar + +from google.protobuf import any_pb2, descriptor, duration_pb2, message as message, timestamp_pb2, wrappers_pb2 +from google.protobuf.internal import containers, enum_type_wrapper + +DESCRIPTOR: descriptor.FileDescriptor + +class Channel(message.Message): + __slots__ = ("ref", "data", "channel_ref", "subchannel_ref", "socket_ref") + REF_FIELD_NUMBER: ClassVar[int] + DATA_FIELD_NUMBER: ClassVar[int] + CHANNEL_REF_FIELD_NUMBER: ClassVar[int] + SUBCHANNEL_REF_FIELD_NUMBER: ClassVar[int] + SOCKET_REF_FIELD_NUMBER: ClassVar[int] + ref: ChannelRef + data: ChannelData + channel_ref: containers.RepeatedCompositeFieldContainer[ChannelRef] + subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] + socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] + def __init__(self, ref: ChannelRef | Mapping | None = ..., data: ChannelData | Mapping | None = ..., channel_ref: Iterable[ChannelRef | Mapping] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping] | None = ..., socket_ref: Iterable[SocketRef | Mapping] | None = ...) -> None: ... + +class Subchannel(message.Message): + __slots__ = ("ref", "data", "channel_ref", "subchannel_ref", "socket_ref") + REF_FIELD_NUMBER: ClassVar[int] + DATA_FIELD_NUMBER: ClassVar[int] + CHANNEL_REF_FIELD_NUMBER: ClassVar[int] + SUBCHANNEL_REF_FIELD_NUMBER: ClassVar[int] + SOCKET_REF_FIELD_NUMBER: ClassVar[int] + ref: SubchannelRef + data: ChannelData + channel_ref: containers.RepeatedCompositeFieldContainer[ChannelRef] + subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] + socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] + def __init__(self, ref: SubchannelRef | Mapping | None = ..., data: ChannelData | Mapping | None = ..., channel_ref: Iterable[ChannelRef | Mapping] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping] | None = ..., socket_ref: Iterable[SocketRef | Mapping] | None = ...) -> None: ... + +class ChannelConnectivityState(message.Message): + __slots__ = ("state",) + class State(int, metaclass=enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + UNKNOWN: ClassVar[ChannelConnectivityState.State] + IDLE: ClassVar[ChannelConnectivityState.State] + CONNECTING: ClassVar[ChannelConnectivityState.State] + READY: ClassVar[ChannelConnectivityState.State] + TRANSIENT_FAILURE: ClassVar[ChannelConnectivityState.State] + SHUTDOWN: ClassVar[ChannelConnectivityState.State] + UNKNOWN: ChannelConnectivityState.State + IDLE: ChannelConnectivityState.State + CONNECTING: ChannelConnectivityState.State + READY: ChannelConnectivityState.State + TRANSIENT_FAILURE: ChannelConnectivityState.State + SHUTDOWN: ChannelConnectivityState.State + STATE_FIELD_NUMBER: ClassVar[int] + state: ChannelConnectivityState.State + def __init__(self, state: ChannelConnectivityState.State | str | None = ...) -> None: ... + +class ChannelData(message.Message): + __slots__ = ("state", "target", "trace", "calls_started", "calls_succeeded", "calls_failed", "last_call_started_timestamp") + STATE_FIELD_NUMBER: ClassVar[int] + TARGET_FIELD_NUMBER: ClassVar[int] + TRACE_FIELD_NUMBER: ClassVar[int] + CALLS_STARTED_FIELD_NUMBER: ClassVar[int] + CALLS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] + CALLS_FAILED_FIELD_NUMBER: ClassVar[int] + LAST_CALL_STARTED_TIMESTAMP_FIELD_NUMBER: ClassVar[int] + state: ChannelConnectivityState + target: str + trace: ChannelTrace + calls_started: int + calls_succeeded: int + calls_failed: int + last_call_started_timestamp: timestamp_pb2.Timestamp + def __init__(self, state: ChannelConnectivityState | Mapping | None = ..., target: str | None = ..., trace: ChannelTrace | Mapping | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping | None = ...) -> None: ... + +class ChannelTraceEvent(message.Message): + __slots__ = ("description", "severity", "timestamp", "channel_ref", "subchannel_ref") + class Severity(int, metaclass=enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + CT_UNKNOWN: ClassVar[ChannelTraceEvent.Severity] + CT_INFO: ClassVar[ChannelTraceEvent.Severity] + CT_WARNING: ClassVar[ChannelTraceEvent.Severity] + CT_ERROR: ClassVar[ChannelTraceEvent.Severity] + CT_UNKNOWN: ChannelTraceEvent.Severity + CT_INFO: ChannelTraceEvent.Severity + CT_WARNING: ChannelTraceEvent.Severity + CT_ERROR: ChannelTraceEvent.Severity + DESCRIPTION_FIELD_NUMBER: ClassVar[int] + SEVERITY_FIELD_NUMBER: ClassVar[int] + TIMESTAMP_FIELD_NUMBER: ClassVar[int] + CHANNEL_REF_FIELD_NUMBER: ClassVar[int] + SUBCHANNEL_REF_FIELD_NUMBER: ClassVar[int] + description: str + severity: ChannelTraceEvent.Severity + timestamp: timestamp_pb2.Timestamp + channel_ref: ChannelRef + subchannel_ref: SubchannelRef + def __init__(self, description: str | None = ..., severity: ChannelTraceEvent.Severity | str | None = ..., timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., channel_ref: ChannelRef | Mapping | None = ..., subchannel_ref: SubchannelRef | Mapping | None = ...) -> None: ... + +class ChannelTrace(message.Message): + __slots__ = ("num_events_logged", "creation_timestamp", "events") + NUM_EVENTS_LOGGED_FIELD_NUMBER: ClassVar[int] + CREATION_TIMESTAMP_FIELD_NUMBER: ClassVar[int] + EVENTS_FIELD_NUMBER: ClassVar[int] + num_events_logged: int + creation_timestamp: timestamp_pb2.Timestamp + events: containers.RepeatedCompositeFieldContainer[ChannelTraceEvent] + def __init__(self, num_events_logged: int | None = ..., creation_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., events: Iterable[ChannelTraceEvent | Mapping] | None = ...) -> None: ... + +class ChannelRef(message.Message): + __slots__ = ("channel_id", "name") + CHANNEL_ID_FIELD_NUMBER: ClassVar[int] + NAME_FIELD_NUMBER: ClassVar[int] + channel_id: int + name: str + def __init__(self, channel_id: int | None = ..., name: str | None = ...) -> None: ... + +class SubchannelRef(message.Message): + __slots__ = ("subchannel_id", "name") + SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] + NAME_FIELD_NUMBER: ClassVar[int] + subchannel_id: int + name: str + def __init__(self, subchannel_id: int | None = ..., name: str | None = ...) -> None: ... + +class SocketRef(message.Message): + __slots__ = ("socket_id", "name") + SOCKET_ID_FIELD_NUMBER: ClassVar[int] + NAME_FIELD_NUMBER: ClassVar[int] + socket_id: int + name: str + def __init__(self, socket_id: int | None = ..., name: str | None = ...) -> None: ... + +class ServerRef(message.Message): + __slots__ = ("server_id", "name") + SERVER_ID_FIELD_NUMBER: ClassVar[int] + NAME_FIELD_NUMBER: ClassVar[int] + server_id: int + name: str + def __init__(self, server_id: int | None = ..., name: str | None = ...) -> None: ... + +class Server(message.Message): + __slots__ = ("ref", "data", "listen_socket") + REF_FIELD_NUMBER: ClassVar[int] + DATA_FIELD_NUMBER: ClassVar[int] + LISTEN_SOCKET_FIELD_NUMBER: ClassVar[int] + ref: ServerRef + data: ServerData + listen_socket: containers.RepeatedCompositeFieldContainer[SocketRef] + def __init__(self, ref: ServerRef | Mapping | None = ..., data: ServerData | Mapping | None = ..., listen_socket: Iterable[SocketRef | Mapping] | None = ...) -> None: ... + +class ServerData(message.Message): + __slots__ = ("trace", "calls_started", "calls_succeeded", "calls_failed", "last_call_started_timestamp") + TRACE_FIELD_NUMBER: ClassVar[int] + CALLS_STARTED_FIELD_NUMBER: ClassVar[int] + CALLS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] + CALLS_FAILED_FIELD_NUMBER: ClassVar[int] + LAST_CALL_STARTED_TIMESTAMP_FIELD_NUMBER: ClassVar[int] + trace: ChannelTrace + calls_started: int + calls_succeeded: int + calls_failed: int + last_call_started_timestamp: timestamp_pb2.Timestamp + def __init__(self, trace: ChannelTrace | Mapping | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping | None = ...) -> None: ... + +class Socket(message.Message): + __slots__ = ("ref", "data", "local", "remote", "security", "remote_name") + REF_FIELD_NUMBER: ClassVar[int] + DATA_FIELD_NUMBER: ClassVar[int] + LOCAL_FIELD_NUMBER: ClassVar[int] + REMOTE_FIELD_NUMBER: ClassVar[int] + SECURITY_FIELD_NUMBER: ClassVar[int] + REMOTE_NAME_FIELD_NUMBER: ClassVar[int] + ref: SocketRef + data: SocketData + local: Address + remote: Address + security: Security + remote_name: str + def __init__(self, ref: SocketRef | Mapping | None = ..., data: SocketData | Mapping | None = ..., local: Address | Mapping | None = ..., remote: Address | Mapping | None = ..., security: Security | Mapping | None = ..., remote_name: str | None = ...) -> None: ... + +class SocketData(message.Message): + __slots__ = ("streams_started", "streams_succeeded", "streams_failed", "messages_sent", "messages_received", "keep_alives_sent", "last_local_stream_created_timestamp", "last_remote_stream_created_timestamp", "last_message_sent_timestamp", "last_message_received_timestamp", "local_flow_control_window", "remote_flow_control_window", "option") + STREAMS_STARTED_FIELD_NUMBER: ClassVar[int] + STREAMS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] + STREAMS_FAILED_FIELD_NUMBER: ClassVar[int] + MESSAGES_SENT_FIELD_NUMBER: ClassVar[int] + MESSAGES_RECEIVED_FIELD_NUMBER: ClassVar[int] + KEEP_ALIVES_SENT_FIELD_NUMBER: ClassVar[int] + LAST_LOCAL_STREAM_CREATED_TIMESTAMP_FIELD_NUMBER: ClassVar[int] + LAST_REMOTE_STREAM_CREATED_TIMESTAMP_FIELD_NUMBER: ClassVar[int] + LAST_MESSAGE_SENT_TIMESTAMP_FIELD_NUMBER: ClassVar[int] + LAST_MESSAGE_RECEIVED_TIMESTAMP_FIELD_NUMBER: ClassVar[int] + LOCAL_FLOW_CONTROL_WINDOW_FIELD_NUMBER: ClassVar[int] + REMOTE_FLOW_CONTROL_WINDOW_FIELD_NUMBER: ClassVar[int] + OPTION_FIELD_NUMBER: ClassVar[int] + streams_started: int + streams_succeeded: int + streams_failed: int + messages_sent: int + messages_received: int + keep_alives_sent: int + last_local_stream_created_timestamp: timestamp_pb2.Timestamp + last_remote_stream_created_timestamp: timestamp_pb2.Timestamp + last_message_sent_timestamp: timestamp_pb2.Timestamp + last_message_received_timestamp: timestamp_pb2.Timestamp + local_flow_control_window: wrappers_pb2.Int64Value + remote_flow_control_window: wrappers_pb2.Int64Value + option: containers.RepeatedCompositeFieldContainer[SocketOption] + def __init__(self, streams_started: int | None = ..., streams_succeeded: int | None = ..., streams_failed: int | None = ..., messages_sent: int | None = ..., messages_received: int | None = ..., keep_alives_sent: int | None = ..., last_local_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., last_remote_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., last_message_sent_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., last_message_received_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., local_flow_control_window: wrappers_pb2.Int64Value | Mapping | None = ..., remote_flow_control_window: wrappers_pb2.Int64Value | Mapping | None = ..., option: Iterable[SocketOption | Mapping] | None = ...) -> None: ... + +class Address(message.Message): + __slots__ = ("tcpip_address", "uds_address", "other_address") + class TcpIpAddress(message.Message): + __slots__ = ("ip_address", "port") + IP_ADDRESS_FIELD_NUMBER: ClassVar[int] + PORT_FIELD_NUMBER: ClassVar[int] + ip_address: bytes + port: int + def __init__(self, ip_address: bytes | None = ..., port: int | None = ...) -> None: ... + class UdsAddress(message.Message): + __slots__ = ("filename",) + FILENAME_FIELD_NUMBER: ClassVar[int] + filename: str + def __init__(self, filename: str | None = ...) -> None: ... + class OtherAddress(message.Message): + __slots__ = ("name", "value") + NAME_FIELD_NUMBER: ClassVar[int] + VALUE_FIELD_NUMBER: ClassVar[int] + name: str + value: any_pb2.Any + def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping | None = ...) -> None: ... + TCPIP_ADDRESS_FIELD_NUMBER: ClassVar[int] + UDS_ADDRESS_FIELD_NUMBER: ClassVar[int] + OTHER_ADDRESS_FIELD_NUMBER: ClassVar[int] + tcpip_address: Address.TcpIpAddress + uds_address: Address.UdsAddress + other_address: Address.OtherAddress + def __init__(self, tcpip_address: Address.TcpIpAddress | Mapping | None = ..., uds_address: Address.UdsAddress | Mapping | None = ..., other_address: Address.OtherAddress | Mapping | None = ...) -> None: ... + +class Security(message.Message): + __slots__ = ("tls", "other") + class Tls(message.Message): + __slots__ = ("standard_name", "other_name", "local_certificate", "remote_certificate") + STANDARD_NAME_FIELD_NUMBER: ClassVar[int] + OTHER_NAME_FIELD_NUMBER: ClassVar[int] + LOCAL_CERTIFICATE_FIELD_NUMBER: ClassVar[int] + REMOTE_CERTIFICATE_FIELD_NUMBER: ClassVar[int] + standard_name: str + other_name: str + local_certificate: bytes + remote_certificate: bytes + def __init__(self, standard_name: str | None = ..., other_name: str | None = ..., local_certificate: bytes | None = ..., remote_certificate: bytes | None = ...) -> None: ... + class OtherSecurity(message.Message): + __slots__ = ("name", "value") + NAME_FIELD_NUMBER: ClassVar[int] + VALUE_FIELD_NUMBER: ClassVar[int] + name: str + value: any_pb2.Any + def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping | None = ...) -> None: ... + TLS_FIELD_NUMBER: ClassVar[int] + OTHER_FIELD_NUMBER: ClassVar[int] + tls: Security.Tls + other: Security.OtherSecurity + def __init__(self, tls: Security.Tls | Mapping | None = ..., other: Security.OtherSecurity | Mapping | None = ...) -> None: ... + +class SocketOption(message.Message): + __slots__ = ("name", "value", "additional") + NAME_FIELD_NUMBER: ClassVar[int] + VALUE_FIELD_NUMBER: ClassVar[int] + ADDITIONAL_FIELD_NUMBER: ClassVar[int] + name: str + value: str + additional: any_pb2.Any + def __init__(self, name: str | None = ..., value: str | None = ..., additional: any_pb2.Any | Mapping | None = ...) -> None: ... + +class SocketOptionTimeout(message.Message): + __slots__ = ("duration",) + DURATION_FIELD_NUMBER: ClassVar[int] + duration: duration_pb2.Duration + def __init__(self, duration: duration_pb2.Duration | Mapping | None = ...) -> None: ... + +class SocketOptionLinger(message.Message): + __slots__ = ("active", "duration") + ACTIVE_FIELD_NUMBER: ClassVar[int] + DURATION_FIELD_NUMBER: ClassVar[int] + active: bool + duration: duration_pb2.Duration + def __init__(self, active: bool = ..., duration: duration_pb2.Duration | Mapping | None = ...) -> None: ... + +class SocketOptionTcpInfo(message.Message): + __slots__ = ("tcpi_state", "tcpi_ca_state", "tcpi_retransmits", "tcpi_probes", "tcpi_backoff", "tcpi_options", "tcpi_snd_wscale", "tcpi_rcv_wscale", "tcpi_rto", "tcpi_ato", "tcpi_snd_mss", "tcpi_rcv_mss", "tcpi_unacked", "tcpi_sacked", "tcpi_lost", "tcpi_retrans", "tcpi_fackets", "tcpi_last_data_sent", "tcpi_last_ack_sent", "tcpi_last_data_recv", "tcpi_last_ack_recv", "tcpi_pmtu", "tcpi_rcv_ssthresh", "tcpi_rtt", "tcpi_rttvar", "tcpi_snd_ssthresh", "tcpi_snd_cwnd", "tcpi_advmss", "tcpi_reordering") + TCPI_STATE_FIELD_NUMBER: ClassVar[int] + TCPI_CA_STATE_FIELD_NUMBER: ClassVar[int] + TCPI_RETRANSMITS_FIELD_NUMBER: ClassVar[int] + TCPI_PROBES_FIELD_NUMBER: ClassVar[int] + TCPI_BACKOFF_FIELD_NUMBER: ClassVar[int] + TCPI_OPTIONS_FIELD_NUMBER: ClassVar[int] + TCPI_SND_WSCALE_FIELD_NUMBER: ClassVar[int] + TCPI_RCV_WSCALE_FIELD_NUMBER: ClassVar[int] + TCPI_RTO_FIELD_NUMBER: ClassVar[int] + TCPI_ATO_FIELD_NUMBER: ClassVar[int] + TCPI_SND_MSS_FIELD_NUMBER: ClassVar[int] + TCPI_RCV_MSS_FIELD_NUMBER: ClassVar[int] + TCPI_UNACKED_FIELD_NUMBER: ClassVar[int] + TCPI_SACKED_FIELD_NUMBER: ClassVar[int] + TCPI_LOST_FIELD_NUMBER: ClassVar[int] + TCPI_RETRANS_FIELD_NUMBER: ClassVar[int] + TCPI_FACKETS_FIELD_NUMBER: ClassVar[int] + TCPI_LAST_DATA_SENT_FIELD_NUMBER: ClassVar[int] + TCPI_LAST_ACK_SENT_FIELD_NUMBER: ClassVar[int] + TCPI_LAST_DATA_RECV_FIELD_NUMBER: ClassVar[int] + TCPI_LAST_ACK_RECV_FIELD_NUMBER: ClassVar[int] + TCPI_PMTU_FIELD_NUMBER: ClassVar[int] + TCPI_RCV_SSTHRESH_FIELD_NUMBER: ClassVar[int] + TCPI_RTT_FIELD_NUMBER: ClassVar[int] + TCPI_RTTVAR_FIELD_NUMBER: ClassVar[int] + TCPI_SND_SSTHRESH_FIELD_NUMBER: ClassVar[int] + TCPI_SND_CWND_FIELD_NUMBER: ClassVar[int] + TCPI_ADVMSS_FIELD_NUMBER: ClassVar[int] + TCPI_REORDERING_FIELD_NUMBER: ClassVar[int] + tcpi_state: int + tcpi_ca_state: int + tcpi_retransmits: int + tcpi_probes: int + tcpi_backoff: int + tcpi_options: int + tcpi_snd_wscale: int + tcpi_rcv_wscale: int + tcpi_rto: int + tcpi_ato: int + tcpi_snd_mss: int + tcpi_rcv_mss: int + tcpi_unacked: int + tcpi_sacked: int + tcpi_lost: int + tcpi_retrans: int + tcpi_fackets: int + tcpi_last_data_sent: int + tcpi_last_ack_sent: int + tcpi_last_data_recv: int + tcpi_last_ack_recv: int + tcpi_pmtu: int + tcpi_rcv_ssthresh: int + tcpi_rtt: int + tcpi_rttvar: int + tcpi_snd_ssthresh: int + tcpi_snd_cwnd: int + tcpi_advmss: int + tcpi_reordering: int + def __init__(self, tcpi_state: int | None = ..., tcpi_ca_state: int | None = ..., tcpi_retransmits: int | None = ..., tcpi_probes: int | None = ..., tcpi_backoff: int | None = ..., tcpi_options: int | None = ..., tcpi_snd_wscale: int | None = ..., tcpi_rcv_wscale: int | None = ..., tcpi_rto: int | None = ..., tcpi_ato: int | None = ..., tcpi_snd_mss: int | None = ..., tcpi_rcv_mss: int | None = ..., tcpi_unacked: int | None = ..., tcpi_sacked: int | None = ..., tcpi_lost: int | None = ..., tcpi_retrans: int | None = ..., tcpi_fackets: int | None = ..., tcpi_last_data_sent: int | None = ..., tcpi_last_ack_sent: int | None = ..., tcpi_last_data_recv: int | None = ..., tcpi_last_ack_recv: int | None = ..., tcpi_pmtu: int | None = ..., tcpi_rcv_ssthresh: int | None = ..., tcpi_rtt: int | None = ..., tcpi_rttvar: int | None = ..., tcpi_snd_ssthresh: int | None = ..., tcpi_snd_cwnd: int | None = ..., tcpi_advmss: int | None = ..., tcpi_reordering: int | None = ...) -> None: ... + +class GetTopChannelsRequest(message.Message): + __slots__ = ("start_channel_id", "max_results") + START_CHANNEL_ID_FIELD_NUMBER: ClassVar[int] + MAX_RESULTS_FIELD_NUMBER: ClassVar[int] + start_channel_id: int + max_results: int + def __init__(self, start_channel_id: int | None = ..., max_results: int | None = ...) -> None: ... + +class GetTopChannelsResponse(message.Message): + __slots__ = ("channel", "end") + CHANNEL_FIELD_NUMBER: ClassVar[int] + END_FIELD_NUMBER: ClassVar[int] + channel: containers.RepeatedCompositeFieldContainer[Channel] + end: bool + def __init__(self, channel: Iterable[Channel | Mapping] | None = ..., end: bool = ...) -> None: ... + +class GetServersRequest(message.Message): + __slots__ = ("start_server_id", "max_results") + START_SERVER_ID_FIELD_NUMBER: ClassVar[int] + MAX_RESULTS_FIELD_NUMBER: ClassVar[int] + start_server_id: int + max_results: int + def __init__(self, start_server_id: int | None = ..., max_results: int | None = ...) -> None: ... + +class GetServersResponse(message.Message): + __slots__ = ("server", "end") + SERVER_FIELD_NUMBER: ClassVar[int] + END_FIELD_NUMBER: ClassVar[int] + server: containers.RepeatedCompositeFieldContainer[Server] + end: bool + def __init__(self, server: Iterable[Server | Mapping] | None = ..., end: bool = ...) -> None: ... + +class GetServerRequest(message.Message): + __slots__ = ("server_id",) + SERVER_ID_FIELD_NUMBER: ClassVar[int] + server_id: int + def __init__(self, server_id: int | None = ...) -> None: ... + +class GetServerResponse(message.Message): + __slots__ = ("server",) + SERVER_FIELD_NUMBER: ClassVar[int] + server: Server + def __init__(self, server: Server | Mapping | None = ...) -> None: ... + +class GetServerSocketsRequest(message.Message): + __slots__ = ("server_id", "start_socket_id", "max_results") + SERVER_ID_FIELD_NUMBER: ClassVar[int] + START_SOCKET_ID_FIELD_NUMBER: ClassVar[int] + MAX_RESULTS_FIELD_NUMBER: ClassVar[int] + server_id: int + start_socket_id: int + max_results: int + def __init__(self, server_id: int | None = ..., start_socket_id: int | None = ..., max_results: int | None = ...) -> None: ... + +class GetServerSocketsResponse(message.Message): + __slots__ = ("socket_ref", "end") + SOCKET_REF_FIELD_NUMBER: ClassVar[int] + END_FIELD_NUMBER: ClassVar[int] + socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] + end: bool + def __init__(self, socket_ref: Iterable[SocketRef | Mapping] | None = ..., end: bool = ...) -> None: ... + +class GetChannelRequest(message.Message): + __slots__ = ("channel_id",) + CHANNEL_ID_FIELD_NUMBER: ClassVar[int] + channel_id: int + def __init__(self, channel_id: int | None = ...) -> None: ... + +class GetChannelResponse(message.Message): + __slots__ = ("channel",) + CHANNEL_FIELD_NUMBER: ClassVar[int] + channel: Channel + def __init__(self, channel: Channel | Mapping | None = ...) -> None: ... + +class GetSubchannelRequest(message.Message): + __slots__ = ("subchannel_id",) + SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] + subchannel_id: int + def __init__(self, subchannel_id: int | None = ...) -> None: ... + +class GetSubchannelResponse(message.Message): + __slots__ = ("subchannel",) + SUBCHANNEL_FIELD_NUMBER: ClassVar[int] + subchannel: Subchannel + def __init__(self, subchannel: Subchannel | Mapping | None = ...) -> None: ... + +class GetSocketRequest(message.Message): + __slots__ = ("socket_id", "summary") + SOCKET_ID_FIELD_NUMBER: ClassVar[int] + SUMMARY_FIELD_NUMBER: ClassVar[int] + socket_id: int + summary: bool + def __init__(self, socket_id: int | None = ..., summary: bool = ...) -> None: ... + +class GetSocketResponse(message.Message): + __slots__ = ("socket",) + SOCKET_FIELD_NUMBER: ClassVar[int] + socket: Socket + def __init__(self, socket: Socket | Mapping | None = ...) -> None: ... diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi new file mode 100644 index 000000000000..bcb43216421e --- /dev/null +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi @@ -0,0 +1,121 @@ +from _typeshed import Incomplete +from typing import Final + +import grpc + +GRPC_GENERATED_VERSION: Final[str] +GRPC_VERSION: Final = grpc.__version__ + +class ChannelzStub: + GetTopChannels: Incomplete + GetServers: Incomplete + GetServer: Incomplete + GetServerSockets: Incomplete + GetChannel: Incomplete + GetSubchannel: Incomplete + GetSocket: Incomplete + def __init__(self, channel: grpc.Channel): ... + +class ChannelzServicer: + def GetTopChannels(self, request, context): ... + def GetServers(self, request, context): ... + def GetServer(self, request, context): ... + def GetServerSockets(self, request, context): ... + def GetChannel(self, request, context): ... + def GetSubchannel(self, request, context): ... + def GetSocket(self, request, context): ... + +def add_ChannelzServicer_to_server(servicer, server) -> None: ... + +class Channelz: + @staticmethod + def GetTopChannels( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... + @staticmethod + def GetServers( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... + @staticmethod + def GetServer( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... + @staticmethod + def GetServerSockets( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... + @staticmethod + def GetChannel( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... + @staticmethod + def GetSubchannel( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... + @staticmethod + def GetSocket( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... diff --git a/stubs/grpcio-health-checking/METADATA.toml b/stubs/grpcio-health-checking/METADATA.toml new file mode 100644 index 000000000000..bac12ed6b8d8 --- /dev/null +++ b/stubs/grpcio-health-checking/METADATA.toml @@ -0,0 +1,3 @@ +version = "1.*" +upstream_repository = "https://github.com/grpc/grpc" +requires = ["types-grpcio", "types-protobuf"] diff --git a/stubs/grpcio-health-checking/grpc_health/__init__.pyi b/stubs/grpcio-health-checking/grpc_health/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/grpcio-health-checking/grpc_health/v1/__init__.pyi b/stubs/grpcio-health-checking/grpc_health/v1/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/grpcio-health-checking/grpc_health/v1/health.pyi b/stubs/grpcio-health-checking/grpc_health/v1/health.pyi new file mode 100644 index 000000000000..0377baa1c3d9 --- /dev/null +++ b/stubs/grpcio-health-checking/grpc_health/v1/health.pyi @@ -0,0 +1,37 @@ +from concurrent import futures +from typing import Any, Final, Protocol, overload +from typing_extensions import Self + +from grpc import ServicerContext +from grpc_health.v1 import health_pb2, health_pb2_grpc + +SERVICE_NAME: Final[str] +OVERALL_HEALTH: Final[str] + +class _Watcher: + def __init__(self) -> None: ... + def __iter__(self) -> Self: ... + def next(self) -> health_pb2.HealthCheckResponse: ... + def __next__(self) -> health_pb2.HealthCheckResponse: ... + def add(self, response: health_pb2.HealthCheckResponse) -> None: ... + def close(self) -> None: ... + +# FIXME: This needs further investigation +class _SendResponseCallback(Protocol): + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class HealthServicer(health_pb2_grpc.HealthServicer): + def __init__( + self, experimental_non_blocking: bool = True, experimental_thread_pool: futures.ThreadPoolExecutor | None = None + ) -> None: ... + def Check(self, request: health_pb2.HealthCheckRequest, context: ServicerContext) -> health_pb2.HealthCheckResponse: ... + @overload + def Watch( + self, request: health_pb2.HealthCheckRequest, context: ServicerContext, send_response_callback: None = None + ) -> _Watcher: ... + @overload + def Watch( + self, request: health_pb2.HealthCheckRequest, context: ServicerContext, send_response_callback: _SendResponseCallback + ) -> None: ... + def set(self, service: str, status: health_pb2.HealthCheckResponse.ServingStatus) -> None: ... + def enter_graceful_shutdown(self) -> None: ... diff --git a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi new file mode 100644 index 000000000000..8c094346f774 --- /dev/null +++ b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi @@ -0,0 +1,28 @@ +from typing import ClassVar + +from google.protobuf import descriptor, message +from google.protobuf.internal import enum_type_wrapper + +DESCRIPTOR: descriptor.FileDescriptor + +class HealthCheckRequest(message.Message): + __slots__ = ("service",) + SERVICE_FIELD_NUMBER: ClassVar[int] + service: str + def __init__(self, service: str | None = ...) -> None: ... + +class HealthCheckResponse(message.Message): + __slots__ = ("status",) + class ServingStatus(int, metaclass=enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + UNKNOWN: ClassVar[HealthCheckResponse.ServingStatus] + SERVING: ClassVar[HealthCheckResponse.ServingStatus] + NOT_SERVING: ClassVar[HealthCheckResponse.ServingStatus] + SERVICE_UNKNOWN: ClassVar[HealthCheckResponse.ServingStatus] + UNKNOWN: HealthCheckResponse.ServingStatus + SERVING: HealthCheckResponse.ServingStatus + NOT_SERVING: HealthCheckResponse.ServingStatus + SERVICE_UNKNOWN: HealthCheckResponse.ServingStatus + STATUS_FIELD_NUMBER: ClassVar[int] + status: HealthCheckResponse.ServingStatus + def __init__(self, status: HealthCheckResponse.ServingStatus | str | None = ...) -> None: ... diff --git a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi new file mode 100644 index 000000000000..eea9f65bacd9 --- /dev/null +++ b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi @@ -0,0 +1,43 @@ +from typing import Final + +import grpc + +GRPC_GENERATED_VERSION: Final[str] +GRPC_VERSION: Final = grpc.__version__ + +class HealthStub: + def __init__(self, channel) -> None: ... + +class HealthServicer: + def Check(self, request, context): ... + def Watch(self, request, context): ... + +def add_HealthServicer_to_server(servicer, server) -> None: ... + +class Health: + @staticmethod + def Check( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... + @staticmethod + def Watch( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... diff --git a/stubs/grpcio/@tests/test_cases/check_reflection.py b/stubs/grpcio-reflection/@tests/test_cases/check_reflection.py similarity index 100% rename from stubs/grpcio/@tests/test_cases/check_reflection.py rename to stubs/grpcio-reflection/@tests/test_cases/check_reflection.py diff --git a/stubs/grpcio/@tests/test_cases/check_reflection_aio.py b/stubs/grpcio-reflection/@tests/test_cases/check_reflection_aio.py similarity index 100% rename from stubs/grpcio/@tests/test_cases/check_reflection_aio.py rename to stubs/grpcio-reflection/@tests/test_cases/check_reflection_aio.py diff --git a/stubs/grpcio-reflection/METADATA.toml b/stubs/grpcio-reflection/METADATA.toml new file mode 100644 index 000000000000..bac12ed6b8d8 --- /dev/null +++ b/stubs/grpcio-reflection/METADATA.toml @@ -0,0 +1,3 @@ +version = "1.*" +upstream_repository = "https://github.com/grpc/grpc" +requires = ["types-grpcio", "types-protobuf"] diff --git a/stubs/grpcio-reflection/grpc_reflection/__init__.pyi b/stubs/grpcio-reflection/grpc_reflection/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/__init__.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/_async.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/_async.pyi new file mode 100644 index 000000000000..39fa94fe1d91 --- /dev/null +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/_async.pyi @@ -0,0 +1,11 @@ +from collections.abc import AsyncIterable + +from grpc_reflection.v1alpha import reflection_pb2 +from grpc_reflection.v1alpha._base import BaseReflectionServicer + +class ReflectionServicer(BaseReflectionServicer): + async def ServerReflectionInfo( + self, request_iterator: AsyncIterable[reflection_pb2.ServerReflectionRequest], unused_context + ) -> AsyncIterable[reflection_pb2.ServerReflectionResponse]: ... + +__all__ = ["ReflectionServicer"] diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/_base.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/_base.pyi new file mode 100644 index 000000000000..e808f4a9147a --- /dev/null +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/_base.pyi @@ -0,0 +1,6 @@ +from grpc_reflection.v1alpha import reflection_pb2_grpc + +class BaseReflectionServicer(reflection_pb2_grpc.ServerReflectionServicer): + def __init__(self, service_names, pool=None) -> None: ... + +__all__ = ["BaseReflectionServicer"] diff --git a/stubs/grpcio/grpc_reflection/v1alpha/reflection.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection.pyi similarity index 60% rename from stubs/grpcio/grpc_reflection/v1alpha/reflection.pyi rename to stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection.pyi index cf75c363f198..05b2d024412a 100644 --- a/stubs/grpcio/grpc_reflection/v1alpha/reflection.pyi +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection.pyi @@ -1,23 +1,28 @@ -import typing_extensions from _typeshed import Incomplete from collections.abc import Iterable +from typing import Final +from typing_extensions import TypeAlias import grpc +import grpc.aio from google.protobuf import descriptor_pool -from grpc import aio from grpc_reflection.v1alpha import reflection_pb2 as _reflection_pb2 from grpc_reflection.v1alpha._base import BaseReflectionServicer -SERVICE_NAME: str +from . import _async as aio -_AnyServer: typing_extensions.TypeAlias = grpc.Server | aio.Server -_AnyServicerContext: typing_extensions.TypeAlias = grpc.ServicerContext | aio.ServicerContext[Incomplete, Incomplete] +SERVICE_NAME: Final[str] + +_AnyServer: TypeAlias = grpc.Server | grpc.aio.Server +_AnyServicerContext: TypeAlias = grpc.ServicerContext | grpc.aio.ServicerContext[Incomplete, Incomplete] class ReflectionServicer(BaseReflectionServicer): def ServerReflectionInfo( self, request_iterator: Iterable[_reflection_pb2.ServerReflectionRequest], context: _AnyServicerContext - ) -> None: ... + ): ... def enable_server_reflection( service_names: Iterable[str], server: _AnyServer, pool: descriptor_pool.DescriptorPool | None = ... ) -> None: ... + +__all__ = ["SERVICE_NAME", "ReflectionServicer", "enable_server_reflection", "aio"] diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi new file mode 100644 index 000000000000..c1ad206b570a --- /dev/null +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi @@ -0,0 +1,81 @@ +from collections.abc import Iterable, Mapping +from typing import ClassVar + +from google.protobuf import descriptor, message +from google.protobuf.internal import containers + +DESCRIPTOR: descriptor.FileDescriptor + +class ServerReflectionRequest(message.Message): + __slots__ = ("host", "file_by_filename", "file_containing_symbol", "file_containing_extension", "all_extension_numbers_of_type", "list_services") + HOST_FIELD_NUMBER: ClassVar[int] + FILE_BY_FILENAME_FIELD_NUMBER: ClassVar[int] + FILE_CONTAINING_SYMBOL_FIELD_NUMBER: ClassVar[int] + FILE_CONTAINING_EXTENSION_FIELD_NUMBER: ClassVar[int] + ALL_EXTENSION_NUMBERS_OF_TYPE_FIELD_NUMBER: ClassVar[int] + LIST_SERVICES_FIELD_NUMBER: ClassVar[int] + host: str + file_by_filename: str + file_containing_symbol: str + file_containing_extension: ExtensionRequest + all_extension_numbers_of_type: str + list_services: str + def __init__(self, host: str | None = ..., file_by_filename: str | None = ..., file_containing_symbol: str | None = ..., file_containing_extension: ExtensionRequest | Mapping | None = ..., all_extension_numbers_of_type: str | None = ..., list_services: str | None = ...) -> None: ... + +class ExtensionRequest(message.Message): + __slots__ = ("containing_type", "extension_number") + CONTAINING_TYPE_FIELD_NUMBER: ClassVar[int] + EXTENSION_NUMBER_FIELD_NUMBER: ClassVar[int] + containing_type: str + extension_number: int + def __init__(self, containing_type: str | None = ..., extension_number: int | None = ...) -> None: ... + +class ServerReflectionResponse(message.Message): + __slots__ = ("valid_host", "original_request", "file_descriptor_response", "all_extension_numbers_response", "list_services_response", "error_response") + VALID_HOST_FIELD_NUMBER: ClassVar[int] + ORIGINAL_REQUEST_FIELD_NUMBER: ClassVar[int] + FILE_DESCRIPTOR_RESPONSE_FIELD_NUMBER: ClassVar[int] + ALL_EXTENSION_NUMBERS_RESPONSE_FIELD_NUMBER: ClassVar[int] + LIST_SERVICES_RESPONSE_FIELD_NUMBER: ClassVar[int] + ERROR_RESPONSE_FIELD_NUMBER: ClassVar[int] + valid_host: str + original_request: ServerReflectionRequest + file_descriptor_response: FileDescriptorResponse + all_extension_numbers_response: ExtensionNumberResponse + list_services_response: ListServiceResponse + error_response: ErrorResponse + def __init__(self, valid_host: str | None = ..., original_request: ServerReflectionRequest | Mapping | None = ..., file_descriptor_response: FileDescriptorResponse | Mapping | None = ..., all_extension_numbers_response: ExtensionNumberResponse | Mapping | None = ..., list_services_response: ListServiceResponse | Mapping | None = ..., error_response: ErrorResponse | Mapping | None = ...) -> None: ... + +class FileDescriptorResponse(message.Message): + __slots__ = ("file_descriptor_proto",) + FILE_DESCRIPTOR_PROTO_FIELD_NUMBER: ClassVar[int] + file_descriptor_proto: containers.RepeatedScalarFieldContainer[bytes] + def __init__(self, file_descriptor_proto: Iterable[bytes] | None = ...) -> None: ... + +class ExtensionNumberResponse(message.Message): + __slots__ = ("base_type_name", "extension_number") + BASE_TYPE_NAME_FIELD_NUMBER: ClassVar[int] + EXTENSION_NUMBER_FIELD_NUMBER: ClassVar[int] + base_type_name: str + extension_number: containers.RepeatedScalarFieldContainer[int] + def __init__(self, base_type_name: str | None = ..., extension_number: Iterable[int] | None = ...) -> None: ... + +class ListServiceResponse(message.Message): + __slots__ = ("service",) + SERVICE_FIELD_NUMBER: ClassVar[int] + service: containers.RepeatedCompositeFieldContainer[ServiceResponse] + def __init__(self, service: Iterable[ServiceResponse | Mapping] | None = ...) -> None: ... + +class ServiceResponse(message.Message): + __slots__ = ("name",) + NAME_FIELD_NUMBER: ClassVar[int] + name: str + def __init__(self, name: str | None = ...) -> None: ... + +class ErrorResponse(message.Message): + __slots__ = ("error_code", "error_message") + ERROR_CODE_FIELD_NUMBER: ClassVar[int] + ERROR_MESSAGE_FIELD_NUMBER: ClassVar[int] + error_code: int + error_message: str + def __init__(self, error_code: int | None = ..., error_message: str | None = ...) -> None: ... diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi new file mode 100644 index 000000000000..86d0a268e1ed --- /dev/null +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi @@ -0,0 +1,31 @@ +from binascii import Incomplete +from typing import Final + +import grpc + +GRPC_GENERATED_VERSION: Final[str] +GRPC_VERSION: Final = grpc.__version__ + +class ServerReflectionStub: + ServerReflectionInfo: Incomplete + def __init__(self, channel: grpc.Channel) -> None: ... + +class ServerReflectionServicer: + def ServerReflectionInfo(self, request_iterator, context): ... + +def add_ServerReflectionServicer_to_server(servicer, server): ... + +class ServerReflection: + @staticmethod + def ServerReflectionInfo( + request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): ... diff --git a/stubs/grpcio/@tests/test_cases/check_status.py b/stubs/grpcio-status/@tests/test_cases/check_status.py similarity index 100% rename from stubs/grpcio/@tests/test_cases/check_status.py rename to stubs/grpcio-status/@tests/test_cases/check_status.py diff --git a/stubs/grpcio-status/METADATA.toml b/stubs/grpcio-status/METADATA.toml new file mode 100644 index 000000000000..a457cd1e6bba --- /dev/null +++ b/stubs/grpcio-status/METADATA.toml @@ -0,0 +1,2 @@ +version = "1.*" +upstream_repository = "https://github.com/grpc/grpc" diff --git a/stubs/grpcio-status/grpc_status/__init__.pyi b/stubs/grpcio-status/grpc_status/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/grpcio/grpc_status/rpc_status.pyi b/stubs/grpcio-status/grpc_status/rpc_status.pyi similarity index 100% rename from stubs/grpcio/grpc_status/rpc_status.pyi rename to stubs/grpcio-status/grpc_status/rpc_status.pyi diff --git a/stubs/grpcio/@tests/stubtest_allowlist.txt b/stubs/grpcio/@tests/stubtest_allowlist.txt index dad6fb3e8ec4..3409137cfdce 100644 --- a/stubs/grpcio/@tests/stubtest_allowlist.txt +++ b/stubs/grpcio/@tests/stubtest_allowlist.txt @@ -4,8 +4,3 @@ grpc.RpcError.code grpc.RpcError.details grpc.RpcError.trailing_metadata - -# Error: is inconsistent -# ============================= -# Stub class is incomplete. -grpc_reflection.v1alpha._base.BaseReflectionServicer.__init__ diff --git a/stubs/grpcio/METADATA.toml b/stubs/grpcio/METADATA.toml index 9c94f65fb2ef..b81a42967303 100644 --- a/stubs/grpcio/METADATA.toml +++ b/stubs/grpcio/METADATA.toml @@ -1,15 +1,6 @@ version = "1.*" upstream_repository = "https://github.com/grpc/grpc" partial_stub = true -requires = [ - "types-protobuf", -] [tool.stubtest] ignore_missing_stub = true -stubtest_requirements = [ - "grpcio-channelz", - "grpcio-health-checking", - "grpcio-reflection", - "grpcio-status", -] diff --git a/stubs/grpcio/grpc_channelz/__init__.pyi b/stubs/grpcio/grpc_channelz/__init__.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_channelz/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_channelz/v1/__init__.pyi b/stubs/grpcio/grpc_channelz/v1/__init__.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_channelz/v1/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_channelz/v1/channelz.pyi b/stubs/grpcio/grpc_channelz/v1/channelz.pyi deleted file mode 100644 index f5aa790e028d..000000000000 --- a/stubs/grpcio/grpc_channelz/v1/channelz.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from grpc import Server - -def add_channelz_servicer(server: Server) -> None: ... diff --git a/stubs/grpcio/grpc_channelz/v1/channelz_pb2.pyi b/stubs/grpcio/grpc_channelz/v1/channelz_pb2.pyi deleted file mode 100644 index fdc2ff0ee872..000000000000 --- a/stubs/grpcio/grpc_channelz/v1/channelz_pb2.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from _typeshed import Incomplete - -GetTopChannelsRequest = Incomplete -GetTopChannelsResponse = Incomplete -GetServersRequest = Incomplete -GetServersResponse = Incomplete -GetServerRequest = Incomplete -GetServerResponse = Incomplete -GetServerSocketsRequest = Incomplete -GetServerSocketsResponse = Incomplete -GetChannelRequest = Incomplete -GetChannelResponse = Incomplete -GetSubchannelRequest = Incomplete -GetSubchannelResponse = Incomplete -GetSocketRequest = Incomplete -GetSocketResponse = Incomplete diff --git a/stubs/grpcio/grpc_channelz/v1/channelz_pb2_grpc.pyi b/stubs/grpcio/grpc_channelz/v1/channelz_pb2_grpc.pyi deleted file mode 100644 index 0b9716abcf75..000000000000 --- a/stubs/grpcio/grpc_channelz/v1/channelz_pb2_grpc.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -ChannelzServicer = Incomplete diff --git a/stubs/grpcio/grpc_health/__init__.pyi b/stubs/grpcio/grpc_health/__init__.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_health/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_health/v1/__init__.pyi b/stubs/grpcio/grpc_health/v1/__init__.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_health/v1/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_health/v1/health.pyi b/stubs/grpcio/grpc_health/v1/health.pyi deleted file mode 100644 index 7ea7dc5d0b50..000000000000 --- a/stubs/grpcio/grpc_health/v1/health.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from concurrent import futures -from typing import Any, Protocol - -from grpc import ServicerContext -from grpc_health.v1 import health_pb2 as _health_pb2, health_pb2_grpc as _health_pb2_grpc - -SERVICE_NAME: str -OVERALL_HEALTH: str - -class _Watcher: - def __init__(self) -> None: ... - def __iter__(self) -> _Watcher: ... - def next(self) -> _health_pb2.HealthCheckResponse: ... - def __next__(self) -> _health_pb2.HealthCheckResponse: ... - def add(self, response: _health_pb2.HealthCheckResponse) -> None: ... - def close(self) -> None: ... - -# FIXME: This needs further investigation -class _SendResponseCallback(Protocol): - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - -class HealthServicer(_health_pb2_grpc.HealthServicer): - def __init__( - self, experimental_non_blocking: bool = ..., experimental_thread_pool: futures.ThreadPoolExecutor | None = ... - ) -> None: ... - def Check(self, request: _health_pb2.HealthCheckRequest, context: ServicerContext) -> _health_pb2.HealthCheckResponse: ... - def Watch( - self, - request: _health_pb2.HealthCheckRequest, - context: ServicerContext, - send_response_callback: _SendResponseCallback | None = ..., - ) -> _health_pb2.HealthCheckResponse: ... - def set(self, service: str, status: _health_pb2.HealthCheckResponse.ServingStatus) -> None: ... - def enter_graceful_shutdown(self) -> None: ... diff --git a/stubs/grpcio/grpc_health/v1/health_pb2.pyi b/stubs/grpcio/grpc_health/v1/health_pb2.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_health/v1/health_pb2.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_health/v1/health_pb2_grpc.pyi b/stubs/grpcio/grpc_health/v1/health_pb2_grpc.pyi deleted file mode 100644 index 8a29ae2fab5b..000000000000 --- a/stubs/grpcio/grpc_health/v1/health_pb2_grpc.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... - -# FIXME: Incomplete -class HealthServicer: ... diff --git a/stubs/grpcio/grpc_reflection/__init__.pyi b/stubs/grpcio/grpc_reflection/__init__.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_reflection/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_reflection/v1alpha/__init__.pyi b/stubs/grpcio/grpc_reflection/v1alpha/__init__.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_reflection/v1alpha/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_reflection/v1alpha/_base.pyi b/stubs/grpcio/grpc_reflection/v1alpha/_base.pyi deleted file mode 100644 index 00704b5062ef..000000000000 --- a/stubs/grpcio/grpc_reflection/v1alpha/_base.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... - -# FIXME: Incomplete -class BaseReflectionServicer: ... diff --git a/stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2.pyi b/stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/grpcio/grpc_status/__init__.pyi b/stubs/grpcio/grpc_status/__init__.pyi deleted file mode 100644 index 0f6820f054ea..000000000000 --- a/stubs/grpcio/grpc_status/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import Incomplete - -def __getattr__(name: str) -> Incomplete: ... From b55c92b734e8765a74d18773dae0fbf973474314 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 18:20:02 -0400 Subject: [PATCH 03/17] Add missing config --- pyrightconfig.stricter.json | 1 + stubs/grpcio-status/METADATA.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 776f3d7df704..1cba7f4512b1 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -45,6 +45,7 @@ "stubs/geopandas", "stubs/google-cloud-ndb", "stubs/grpcio/grpc/__init__.pyi", + "stubs/grpcio/grpc_status/rpc_status.pyi", "stubs/hdbcli/hdbcli/dbapi.pyi", "stubs/html5lib", "stubs/httplib2", diff --git a/stubs/grpcio-status/METADATA.toml b/stubs/grpcio-status/METADATA.toml index a457cd1e6bba..f70c0410a6a0 100644 --- a/stubs/grpcio-status/METADATA.toml +++ b/stubs/grpcio-status/METADATA.toml @@ -1,2 +1,3 @@ version = "1.*" upstream_repository = "https://github.com/grpc/grpc" +requires = ["types-grpcio"] From 66d7f139331d61479a196c6d8b1a1009664284be Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 18:31:19 -0400 Subject: [PATCH 04/17] Add missing generic and run stubdefaulter --- .../grpc_channelz/v1/channelz_pb2.pyi | 47 +++--- .../grpc_reflection/v1alpha/reflection.pyi | 2 +- .../v1alpha/reflection_pb2.pyi | 7 +- stubs/grpcio/grpc/__init__.pyi | 154 +++++++++--------- stubs/grpcio/grpc/aio/__init__.pyi | 92 +++++------ 5 files changed, 152 insertions(+), 150 deletions(-) diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi index b453522aae9c..f2423e34cefb 100644 --- a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterable, Mapping from typing import ClassVar @@ -18,7 +19,7 @@ class Channel(message.Message): channel_ref: containers.RepeatedCompositeFieldContainer[ChannelRef] subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] - def __init__(self, ref: ChannelRef | Mapping | None = ..., data: ChannelData | Mapping | None = ..., channel_ref: Iterable[ChannelRef | Mapping] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping] | None = ..., socket_ref: Iterable[SocketRef | Mapping] | None = ...) -> None: ... + def __init__(self, ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... class Subchannel(message.Message): __slots__ = ("ref", "data", "channel_ref", "subchannel_ref", "socket_ref") @@ -32,7 +33,7 @@ class Subchannel(message.Message): channel_ref: containers.RepeatedCompositeFieldContainer[ChannelRef] subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] - def __init__(self, ref: SubchannelRef | Mapping | None = ..., data: ChannelData | Mapping | None = ..., channel_ref: Iterable[ChannelRef | Mapping] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping] | None = ..., socket_ref: Iterable[SocketRef | Mapping] | None = ...) -> None: ... + def __init__(self, ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ..., data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... class ChannelConnectivityState(message.Message): __slots__ = ("state",) @@ -70,7 +71,7 @@ class ChannelData(message.Message): calls_succeeded: int calls_failed: int last_call_started_timestamp: timestamp_pb2.Timestamp - def __init__(self, state: ChannelConnectivityState | Mapping | None = ..., target: str | None = ..., trace: ChannelTrace | Mapping | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping | None = ...) -> None: ... + def __init__(self, state: ChannelConnectivityState | Mapping[Incomplete, Incomplete] | None = ..., target: str | None = ..., trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class ChannelTraceEvent(message.Message): __slots__ = ("description", "severity", "timestamp", "channel_ref", "subchannel_ref") @@ -94,7 +95,7 @@ class ChannelTraceEvent(message.Message): timestamp: timestamp_pb2.Timestamp channel_ref: ChannelRef subchannel_ref: SubchannelRef - def __init__(self, description: str | None = ..., severity: ChannelTraceEvent.Severity | str | None = ..., timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., channel_ref: ChannelRef | Mapping | None = ..., subchannel_ref: SubchannelRef | Mapping | None = ...) -> None: ... + def __init__(self, description: str | None = ..., severity: ChannelTraceEvent.Severity | str | None = ..., timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., subchannel_ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class ChannelTrace(message.Message): __slots__ = ("num_events_logged", "creation_timestamp", "events") @@ -104,7 +105,7 @@ class ChannelTrace(message.Message): num_events_logged: int creation_timestamp: timestamp_pb2.Timestamp events: containers.RepeatedCompositeFieldContainer[ChannelTraceEvent] - def __init__(self, num_events_logged: int | None = ..., creation_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., events: Iterable[ChannelTraceEvent | Mapping] | None = ...) -> None: ... + def __init__(self, num_events_logged: int | None = ..., creation_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., events: Iterable[ChannelTraceEvent | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... class ChannelRef(message.Message): __slots__ = ("channel_id", "name") @@ -146,7 +147,7 @@ class Server(message.Message): ref: ServerRef data: ServerData listen_socket: containers.RepeatedCompositeFieldContainer[SocketRef] - def __init__(self, ref: ServerRef | Mapping | None = ..., data: ServerData | Mapping | None = ..., listen_socket: Iterable[SocketRef | Mapping] | None = ...) -> None: ... + def __init__(self, ref: ServerRef | Mapping[Incomplete, Incomplete] | None = ..., data: ServerData | Mapping[Incomplete, Incomplete] | None = ..., listen_socket: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... class ServerData(message.Message): __slots__ = ("trace", "calls_started", "calls_succeeded", "calls_failed", "last_call_started_timestamp") @@ -160,7 +161,7 @@ class ServerData(message.Message): calls_succeeded: int calls_failed: int last_call_started_timestamp: timestamp_pb2.Timestamp - def __init__(self, trace: ChannelTrace | Mapping | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping | None = ...) -> None: ... + def __init__(self, trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class Socket(message.Message): __slots__ = ("ref", "data", "local", "remote", "security", "remote_name") @@ -176,7 +177,7 @@ class Socket(message.Message): remote: Address security: Security remote_name: str - def __init__(self, ref: SocketRef | Mapping | None = ..., data: SocketData | Mapping | None = ..., local: Address | Mapping | None = ..., remote: Address | Mapping | None = ..., security: Security | Mapping | None = ..., remote_name: str | None = ...) -> None: ... + def __init__(self, ref: SocketRef | Mapping[Incomplete, Incomplete] | None = ..., data: SocketData | Mapping[Incomplete, Incomplete] | None = ..., local: Address | Mapping[Incomplete, Incomplete] | None = ..., remote: Address | Mapping[Incomplete, Incomplete] | None = ..., security: Security | Mapping[Incomplete, Incomplete] | None = ..., remote_name: str | None = ...) -> None: ... class SocketData(message.Message): __slots__ = ("streams_started", "streams_succeeded", "streams_failed", "messages_sent", "messages_received", "keep_alives_sent", "last_local_stream_created_timestamp", "last_remote_stream_created_timestamp", "last_message_sent_timestamp", "last_message_received_timestamp", "local_flow_control_window", "remote_flow_control_window", "option") @@ -206,7 +207,7 @@ class SocketData(message.Message): local_flow_control_window: wrappers_pb2.Int64Value remote_flow_control_window: wrappers_pb2.Int64Value option: containers.RepeatedCompositeFieldContainer[SocketOption] - def __init__(self, streams_started: int | None = ..., streams_succeeded: int | None = ..., streams_failed: int | None = ..., messages_sent: int | None = ..., messages_received: int | None = ..., keep_alives_sent: int | None = ..., last_local_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., last_remote_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., last_message_sent_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., last_message_received_timestamp: timestamp_pb2.Timestamp | Mapping | None = ..., local_flow_control_window: wrappers_pb2.Int64Value | Mapping | None = ..., remote_flow_control_window: wrappers_pb2.Int64Value | Mapping | None = ..., option: Iterable[SocketOption | Mapping] | None = ...) -> None: ... + def __init__(self, streams_started: int | None = ..., streams_succeeded: int | None = ..., streams_failed: int | None = ..., messages_sent: int | None = ..., messages_received: int | None = ..., keep_alives_sent: int | None = ..., last_local_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_remote_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_message_sent_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_message_received_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., local_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., remote_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., option: Iterable[SocketOption | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... class Address(message.Message): __slots__ = ("tcpip_address", "uds_address", "other_address") @@ -228,14 +229,14 @@ class Address(message.Message): VALUE_FIELD_NUMBER: ClassVar[int] name: str value: any_pb2.Any - def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping | None = ...) -> None: ... + def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... TCPIP_ADDRESS_FIELD_NUMBER: ClassVar[int] UDS_ADDRESS_FIELD_NUMBER: ClassVar[int] OTHER_ADDRESS_FIELD_NUMBER: ClassVar[int] tcpip_address: Address.TcpIpAddress uds_address: Address.UdsAddress other_address: Address.OtherAddress - def __init__(self, tcpip_address: Address.TcpIpAddress | Mapping | None = ..., uds_address: Address.UdsAddress | Mapping | None = ..., other_address: Address.OtherAddress | Mapping | None = ...) -> None: ... + def __init__(self, tcpip_address: Address.TcpIpAddress | Mapping[Incomplete, Incomplete] | None = ..., uds_address: Address.UdsAddress | Mapping[Incomplete, Incomplete] | None = ..., other_address: Address.OtherAddress | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class Security(message.Message): __slots__ = ("tls", "other") @@ -256,12 +257,12 @@ class Security(message.Message): VALUE_FIELD_NUMBER: ClassVar[int] name: str value: any_pb2.Any - def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping | None = ...) -> None: ... + def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... TLS_FIELD_NUMBER: ClassVar[int] OTHER_FIELD_NUMBER: ClassVar[int] tls: Security.Tls other: Security.OtherSecurity - def __init__(self, tls: Security.Tls | Mapping | None = ..., other: Security.OtherSecurity | Mapping | None = ...) -> None: ... + def __init__(self, tls: Security.Tls | Mapping[Incomplete, Incomplete] | None = ..., other: Security.OtherSecurity | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class SocketOption(message.Message): __slots__ = ("name", "value", "additional") @@ -271,13 +272,13 @@ class SocketOption(message.Message): name: str value: str additional: any_pb2.Any - def __init__(self, name: str | None = ..., value: str | None = ..., additional: any_pb2.Any | Mapping | None = ...) -> None: ... + def __init__(self, name: str | None = ..., value: str | None = ..., additional: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class SocketOptionTimeout(message.Message): __slots__ = ("duration",) DURATION_FIELD_NUMBER: ClassVar[int] duration: duration_pb2.Duration - def __init__(self, duration: duration_pb2.Duration | Mapping | None = ...) -> None: ... + def __init__(self, duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class SocketOptionLinger(message.Message): __slots__ = ("active", "duration") @@ -285,7 +286,7 @@ class SocketOptionLinger(message.Message): DURATION_FIELD_NUMBER: ClassVar[int] active: bool duration: duration_pb2.Duration - def __init__(self, active: bool = ..., duration: duration_pb2.Duration | Mapping | None = ...) -> None: ... + def __init__(self, active: bool = ..., duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class SocketOptionTcpInfo(message.Message): __slots__ = ("tcpi_state", "tcpi_ca_state", "tcpi_retransmits", "tcpi_probes", "tcpi_backoff", "tcpi_options", "tcpi_snd_wscale", "tcpi_rcv_wscale", "tcpi_rto", "tcpi_ato", "tcpi_snd_mss", "tcpi_rcv_mss", "tcpi_unacked", "tcpi_sacked", "tcpi_lost", "tcpi_retrans", "tcpi_fackets", "tcpi_last_data_sent", "tcpi_last_ack_sent", "tcpi_last_data_recv", "tcpi_last_ack_recv", "tcpi_pmtu", "tcpi_rcv_ssthresh", "tcpi_rtt", "tcpi_rttvar", "tcpi_snd_ssthresh", "tcpi_snd_cwnd", "tcpi_advmss", "tcpi_reordering") @@ -363,7 +364,7 @@ class GetTopChannelsResponse(message.Message): END_FIELD_NUMBER: ClassVar[int] channel: containers.RepeatedCompositeFieldContainer[Channel] end: bool - def __init__(self, channel: Iterable[Channel | Mapping] | None = ..., end: bool = ...) -> None: ... + def __init__(self, channel: Iterable[Channel | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ...) -> None: ... class GetServersRequest(message.Message): __slots__ = ("start_server_id", "max_results") @@ -379,7 +380,7 @@ class GetServersResponse(message.Message): END_FIELD_NUMBER: ClassVar[int] server: containers.RepeatedCompositeFieldContainer[Server] end: bool - def __init__(self, server: Iterable[Server | Mapping] | None = ..., end: bool = ...) -> None: ... + def __init__(self, server: Iterable[Server | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ...) -> None: ... class GetServerRequest(message.Message): __slots__ = ("server_id",) @@ -391,7 +392,7 @@ class GetServerResponse(message.Message): __slots__ = ("server",) SERVER_FIELD_NUMBER: ClassVar[int] server: Server - def __init__(self, server: Server | Mapping | None = ...) -> None: ... + def __init__(self, server: Server | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class GetServerSocketsRequest(message.Message): __slots__ = ("server_id", "start_socket_id", "max_results") @@ -409,7 +410,7 @@ class GetServerSocketsResponse(message.Message): END_FIELD_NUMBER: ClassVar[int] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] end: bool - def __init__(self, socket_ref: Iterable[SocketRef | Mapping] | None = ..., end: bool = ...) -> None: ... + def __init__(self, socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ...) -> None: ... class GetChannelRequest(message.Message): __slots__ = ("channel_id",) @@ -421,7 +422,7 @@ class GetChannelResponse(message.Message): __slots__ = ("channel",) CHANNEL_FIELD_NUMBER: ClassVar[int] channel: Channel - def __init__(self, channel: Channel | Mapping | None = ...) -> None: ... + def __init__(self, channel: Channel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class GetSubchannelRequest(message.Message): __slots__ = ("subchannel_id",) @@ -433,7 +434,7 @@ class GetSubchannelResponse(message.Message): __slots__ = ("subchannel",) SUBCHANNEL_FIELD_NUMBER: ClassVar[int] subchannel: Subchannel - def __init__(self, subchannel: Subchannel | Mapping | None = ...) -> None: ... + def __init__(self, subchannel: Subchannel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class GetSocketRequest(message.Message): __slots__ = ("socket_id", "summary") @@ -447,4 +448,4 @@ class GetSocketResponse(message.Message): __slots__ = ("socket",) SOCKET_FIELD_NUMBER: ClassVar[int] socket: Socket - def __init__(self, socket: Socket | Mapping | None = ...) -> None: ... + def __init__(self, socket: Socket | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection.pyi index 05b2d024412a..8b336b9bee3c 100644 --- a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection.pyi +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection.pyi @@ -22,7 +22,7 @@ class ReflectionServicer(BaseReflectionServicer): ): ... def enable_server_reflection( - service_names: Iterable[str], server: _AnyServer, pool: descriptor_pool.DescriptorPool | None = ... + service_names: Iterable[str], server: _AnyServer, pool: descriptor_pool.DescriptorPool | None = None ) -> None: ... __all__ = ["SERVICE_NAME", "ReflectionServicer", "enable_server_reflection", "aio"] diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi index c1ad206b570a..12b7ee4273e6 100644 --- a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Iterable, Mapping from typing import ClassVar @@ -20,7 +21,7 @@ class ServerReflectionRequest(message.Message): file_containing_extension: ExtensionRequest all_extension_numbers_of_type: str list_services: str - def __init__(self, host: str | None = ..., file_by_filename: str | None = ..., file_containing_symbol: str | None = ..., file_containing_extension: ExtensionRequest | Mapping | None = ..., all_extension_numbers_of_type: str | None = ..., list_services: str | None = ...) -> None: ... + def __init__(self, host: str | None = ..., file_by_filename: str | None = ..., file_containing_symbol: str | None = ..., file_containing_extension: ExtensionRequest | Mapping[Incomplete, Incomplete] | None = ..., all_extension_numbers_of_type: str | None = ..., list_services: str | None = ...) -> None: ... class ExtensionRequest(message.Message): __slots__ = ("containing_type", "extension_number") @@ -44,7 +45,7 @@ class ServerReflectionResponse(message.Message): all_extension_numbers_response: ExtensionNumberResponse list_services_response: ListServiceResponse error_response: ErrorResponse - def __init__(self, valid_host: str | None = ..., original_request: ServerReflectionRequest | Mapping | None = ..., file_descriptor_response: FileDescriptorResponse | Mapping | None = ..., all_extension_numbers_response: ExtensionNumberResponse | Mapping | None = ..., list_services_response: ListServiceResponse | Mapping | None = ..., error_response: ErrorResponse | Mapping | None = ...) -> None: ... + def __init__(self, valid_host: str | None = ..., original_request: ServerReflectionRequest | Mapping[Incomplete, Incomplete] | None = ..., file_descriptor_response: FileDescriptorResponse | Mapping[Incomplete, Incomplete] | None = ..., all_extension_numbers_response: ExtensionNumberResponse | Mapping[Incomplete, Incomplete] | None = ..., list_services_response: ListServiceResponse | Mapping[Incomplete, Incomplete] | None = ..., error_response: ErrorResponse | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... class FileDescriptorResponse(message.Message): __slots__ = ("file_descriptor_proto",) @@ -64,7 +65,7 @@ class ListServiceResponse(message.Message): __slots__ = ("service",) SERVICE_FIELD_NUMBER: ClassVar[int] service: containers.RepeatedCompositeFieldContainer[ServiceResponse] - def __init__(self, service: Iterable[ServiceResponse | Mapping] | None = ...) -> None: ... + def __init__(self, service: Iterable[ServiceResponse | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... class ServiceResponse(message.Message): __slots__ = ("name",) diff --git a/stubs/grpcio/grpc/__init__.pyi b/stubs/grpcio/grpc/__init__.pyi index 8f370e86a0e6..e9b74482a677 100644 --- a/stubs/grpcio/grpc/__init__.pyi +++ b/stubs/grpcio/grpc/__init__.pyi @@ -79,21 +79,21 @@ class Future(abc.ABC, Generic[_TFutureValue]): @abc.abstractmethod def done(self) -> bool: ... @abc.abstractmethod - def exception(self, timeout: float | None = ...) -> Exception | None: ... + def exception(self, timeout: float | None = None) -> Exception | None: ... @abc.abstractmethod - def result(self, timeout: float | None = ...) -> _TFutureValue: ... + def result(self, timeout: float | None = None) -> _TFutureValue: ... @abc.abstractmethod def running(self) -> bool: ... # FIXME: unsure of the exact return type here. Is it a traceback.StackSummary? @abc.abstractmethod - def traceback(self, timeout: float | None = ...) -> Any: ... + def traceback(self, timeout: float | None = None) -> Any: ... # Create Client: -def insecure_channel(target: str, options: _Options | None = ..., compression: Compression | None = ...) -> Channel: ... +def insecure_channel(target: str, options: _Options | None = None, compression: Compression | None = None) -> Channel: ... def secure_channel( - target: str, credentials: ChannelCredentials, options: _Options | None = ..., compression: Compression | None = ... + target: str, credentials: ChannelCredentials, options: _Options | None = None, compression: Compression | None = None ) -> Channel: ... _Interceptor: TypeAlias = ( @@ -108,14 +108,14 @@ def intercept_channel(channel: Channel, *interceptors: _Interceptor[_TRequest, _ # Create Client Credentials: def ssl_channel_credentials( - root_certificates: bytes | None = ..., private_key: bytes | None = ..., certificate_chain: bytes | None = ... + root_certificates: bytes | None = None, private_key: bytes | None = None, certificate_chain: bytes | None = None ) -> ChannelCredentials: ... def local_channel_credentials(local_connect_type: LocalConnectionType = ...) -> ChannelCredentials: ... -def metadata_call_credentials(metadata_plugin: AuthMetadataPlugin, name: str | None = ...) -> CallCredentials: ... +def metadata_call_credentials(metadata_plugin: AuthMetadataPlugin, name: str | None = None) -> CallCredentials: ... def access_token_call_credentials(access_token: str) -> CallCredentials: ... -def alts_channel_credentials(service_accounts: Sequence[str] | None = ...) -> ChannelCredentials: ... +def alts_channel_credentials(service_accounts: Sequence[str] | None = None) -> ChannelCredentials: ... def compute_engine_channel_credentials(call_credentials: CallCredentials) -> ChannelCredentials: ... -def xds_channel_credentials(fallback_credentials: ChannelCredentials | None = ...) -> ChannelCredentials: ... +def xds_channel_credentials(fallback_credentials: ChannelCredentials | None = None) -> ChannelCredentials: ... # GRPC docs say there should be at least two: def composite_call_credentials(creds1: CallCredentials, creds2: CallCredentials, *rest: CallCredentials) -> CallCredentials: ... @@ -129,12 +129,12 @@ def composite_channel_credentials( def server( thread_pool: futures.ThreadPoolExecutor, - handlers: list[GenericRpcHandler[Any, Any]] | None = ..., - interceptors: list[ServerInterceptor[Any, Any]] | None = ..., - options: _Options | None = ..., - maximum_concurrent_rpcs: int | None = ..., - compression: Compression | None = ..., - xds: bool = ..., + handlers: list[GenericRpcHandler[Any, Any]] | None = None, + interceptors: list[ServerInterceptor[Any, Any]] | None = None, + options: _Options | None = None, + maximum_concurrent_rpcs: int | None = None, + compression: Compression | None = None, + xds: bool = False, ) -> Server: ... # Create Server Credentials: @@ -143,17 +143,17 @@ _CertificateChainPair: TypeAlias = tuple[bytes, bytes] def ssl_server_credentials( private_key_certificate_chain_pairs: list[_CertificateChainPair], - root_certificates: bytes | None = ..., - require_client_auth: bool = ..., + root_certificates: bytes | None = None, + require_client_auth: bool = False, ) -> ServerCredentials: ... def local_server_credentials(local_connect_type: LocalConnectionType = ...) -> ServerCredentials: ... def ssl_server_certificate_configuration( - private_key_certificate_chain_pairs: list[_CertificateChainPair], root_certificates: bytes | None = ... + private_key_certificate_chain_pairs: list[_CertificateChainPair], root_certificates: bytes | None = None ) -> ServerCertificateConfiguration: ... def dynamic_ssl_server_credentials( initial_certificate_configuration: ServerCertificateConfiguration, certificate_configuration_fetcher: Callable[[], ServerCertificateConfiguration], - require_client_authentication: bool = ..., + require_client_authentication: bool = False, ) -> ServerCredentials: ... def alts_server_credentials() -> ServerCredentials: ... def insecure_server_credentials() -> ServerCredentials: ... @@ -174,23 +174,23 @@ class _Behaviour(Protocol): def unary_unary_rpc_method_handler( behavior: _Behaviour, - request_deserializer: _RequestDeserializer | None = ..., - response_serializer: _ResponseSerializer | None = ..., + request_deserializer: _RequestDeserializer | None = None, + response_serializer: _ResponseSerializer | None = None, ) -> RpcMethodHandler[Any, Any]: ... def unary_stream_rpc_method_handler( behavior: _Behaviour, - request_deserializer: _RequestDeserializer | None = ..., - response_serializer: _ResponseSerializer | None = ..., + request_deserializer: _RequestDeserializer | None = None, + response_serializer: _ResponseSerializer | None = None, ) -> RpcMethodHandler[Any, Any]: ... def stream_unary_rpc_method_handler( behavior: _Behaviour, - request_deserializer: _RequestDeserializer | None = ..., - response_serializer: _ResponseSerializer | None = ..., + request_deserializer: _RequestDeserializer | None = None, + response_serializer: _ResponseSerializer | None = None, ) -> RpcMethodHandler[Any, Any]: ... def stream_stream_rpc_method_handler( behavior: _Behaviour, - request_deserializer: _RequestDeserializer | None = ..., - response_serializer: _ResponseSerializer | None = ..., + request_deserializer: _RequestDeserializer | None = None, + response_serializer: _ResponseSerializer | None = None, ) -> RpcMethodHandler[Any, Any]: ... def method_handlers_generic_handler( service: str, method_handlers: dict[str, RpcMethodHandler[Any, Any]] @@ -248,31 +248,31 @@ class Channel(abc.ABC): def stream_stream( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> StreamStreamMultiCallable[Any, Any]: ... @abc.abstractmethod def stream_unary( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> StreamUnaryMultiCallable[Any, Any]: ... @abc.abstractmethod - def subscribe(self, callback: Callable[[ChannelConnectivity], None], try_to_connect: bool = ...) -> None: ... + def subscribe(self, callback: Callable[[ChannelConnectivity], None], try_to_connect: bool = False) -> None: ... @abc.abstractmethod def unary_stream( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> UnaryStreamMultiCallable[Any, Any]: ... @abc.abstractmethod def unary_unary( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> UnaryUnaryMultiCallable[Any, Any]: ... @abc.abstractmethod def unsubscribe(self, callback: Callable[[ChannelConnectivity], None]) -> None: ... @@ -303,7 +303,7 @@ class Server(abc.ABC): # Block current thread until the server stops. Returns a bool # indicates if the operation times out. Timeout is in seconds. - def wait_for_termination(self, timeout: float | None = ...) -> bool: ... + def wait_for_termination(self, timeout: float | None = None) -> bool: ... # Authentication & Authorization Objects: @@ -538,34 +538,34 @@ class UnaryUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request: _TRequest, - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> _TResponse: ... @abc.abstractmethod def future( self, request: _TRequest, - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> _CallFuture[_TResponse]: ... @abc.abstractmethod def with_call( self, request: _TRequest, - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, # FIXME: Return value is documented as "The response value for the RPC and a Call value for the RPC"; # this is slightly unclear so this return type is a best-effort guess. ) -> tuple[_TResponse, Call]: ... @@ -575,12 +575,12 @@ class UnaryStreamMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request: _TRequest, - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> _CallIterator[_TResponse]: ... class StreamUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): @@ -588,34 +588,34 @@ class StreamUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request_iterator: Iterator[_TRequest], - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> _TResponse: ... @abc.abstractmethod def future( self, request_iterator: Iterator[_TRequest], - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> _CallFuture[_TResponse]: ... @abc.abstractmethod def with_call( self, request_iterator: Iterator[_TRequest], - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, # FIXME: Return value is documented as "The response value for the RPC and a Call value for the RPC"; # this is slightly unclear so this return type is a best-effort guess. ) -> tuple[_TResponse, Call]: ... @@ -625,12 +625,12 @@ class StreamStreamMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request_iterator: Iterator[_TRequest], - timeout: float | None = ..., - metadata: _Metadata | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _Metadata | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> _CallIterator[_TResponse]: ... # Runtime Protobuf Parsing: diff --git a/stubs/grpcio/grpc/aio/__init__.pyi b/stubs/grpcio/grpc/aio/__init__.pyi index 8a9cb36bb9e6..e82b0b1bd147 100644 --- a/stubs/grpcio/grpc/aio/__init__.pyi +++ b/stubs/grpcio/grpc/aio/__init__.pyi @@ -37,8 +37,8 @@ class AioRpcError(RpcError): code: StatusCode, initial_metadata: Metadata, trailing_metadata: Metadata, - details: str | None = ..., - debug_error_string: str | None = ..., + details: str | None = None, + debug_error_string: str | None = None, ) -> None: ... # FIXME: confirm if these are present in the parent type. The remaining @@ -52,27 +52,27 @@ class ClientInterceptor(metaclass=abc.ABCMeta): ... def insecure_channel( target: str, - options: _Options | None = ..., - compression: Compression | None = ..., - interceptors: Sequence[ClientInterceptor] | None = ..., + options: _Options | None = None, + compression: Compression | None = None, + interceptors: Sequence[ClientInterceptor] | None = None, ) -> Channel: ... def secure_channel( target: str, credentials: ChannelCredentials, - options: _Options | None = ..., - compression: Compression | None = ..., - interceptors: Sequence[ClientInterceptor] | None = ..., + options: _Options | None = None, + compression: Compression | None = None, + interceptors: Sequence[ClientInterceptor] | None = None, ) -> Channel: ... # Create Server: def server( - migration_thread_pool: futures.Executor | None = ..., - handlers: Sequence[GenericRpcHandler[Any, Any]] | None = ..., - interceptors: Sequence[ServerInterceptor[Any, Any]] | None = ..., - options: _Options | None = ..., - maximum_concurrent_rpcs: int | None = ..., - compression: Compression | None = ..., + migration_thread_pool: futures.Executor | None = None, + handlers: Sequence[GenericRpcHandler[Any, Any]] | None = None, + interceptors: Sequence[ServerInterceptor[Any, Any]] | None = None, + options: _Options | None = None, + maximum_concurrent_rpcs: int | None = None, + compression: Compression | None = None, ) -> Server: ... # Channel Object: @@ -85,38 +85,38 @@ _ResponseDeserializer: TypeAlias = Callable[[bytes], Any] class Channel(abc.ABC): @abc.abstractmethod - async def close(self, grace: float | None = ...) -> None: ... + async def close(self, grace: float | None = None) -> None: ... @abc.abstractmethod - def get_state(self, try_to_connect: bool = ...) -> ChannelConnectivity: ... + def get_state(self, try_to_connect: bool = False) -> ChannelConnectivity: ... @abc.abstractmethod async def wait_for_state_change(self, last_observed_state: ChannelConnectivity) -> None: ... @abc.abstractmethod def stream_stream( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> StreamStreamMultiCallable[Any, Any]: ... @abc.abstractmethod def stream_unary( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> StreamUnaryMultiCallable[Any, Any]: ... @abc.abstractmethod def unary_stream( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> UnaryStreamMultiCallable[Any, Any]: ... @abc.abstractmethod def unary_unary( self, method: str, - request_serializer: _RequestSerializer | None = ..., - response_deserializer: _ResponseDeserializer | None = ..., + request_serializer: _RequestSerializer | None = None, + response_deserializer: _ResponseDeserializer | None = None, ) -> UnaryUnaryMultiCallable[Any, Any]: ... @abc.abstractmethod async def __aenter__(self) -> Self: ... @@ -149,7 +149,7 @@ class Server(metaclass=abc.ABCMeta): # Returns a bool indicates if the operation times out. Timeout is in seconds. @abc.abstractmethod - async def wait_for_termination(self, timeout: float | None = ...) -> bool: ... + async def wait_for_termination(self, timeout: float | None = None) -> bool: ... # Client-Side Context: @@ -216,7 +216,7 @@ class _DoneCallback(Generic[_TRequest, _TResponse]): class ServicerContext(Generic[_TRequest, _TResponse], metaclass=abc.ABCMeta): @abc.abstractmethod - async def abort(self, code: StatusCode, details: str = ..., trailing_metadata: _MetadataType = ...) -> NoReturn: ... + async def abort(self, code: StatusCode, details: str = '', trailing_metadata: _MetadataType = ()) -> NoReturn: ... @abc.abstractmethod async def read(self) -> _TRequest: ... @abc.abstractmethod @@ -377,12 +377,12 @@ class UnaryUnaryMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABCM self, request: _TRequest, *, - timeout: float | None = ..., - metadata: _MetadataType | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _MetadataType | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> UnaryUnaryCall[_TRequest, _TResponse]: ... class UnaryStreamMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABCMeta): @@ -391,12 +391,12 @@ class UnaryStreamMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABC self, request: _TRequest, *, - timeout: float | None = ..., - metadata: _MetadataType | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _MetadataType | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> UnaryStreamCall[_TRequest, _TResponse]: ... class StreamUnaryMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABCMeta): @@ -404,12 +404,12 @@ class StreamUnaryMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABC def __call__( self, request_iterator: AsyncIterator[_TRequest] | Iterator[_TRequest] | None = None, - timeout: float | None = ..., - metadata: _MetadataType | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _MetadataType | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> StreamUnaryCall[_TRequest, _TResponse]: ... class StreamStreamMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABCMeta): @@ -417,12 +417,12 @@ class StreamStreamMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.AB def __call__( self, request_iterator: AsyncIterator[_TRequest] | Iterator[_TRequest] | None = None, - timeout: float | None = ..., - metadata: _MetadataType | None = ..., - credentials: CallCredentials | None = ..., + timeout: float | None = None, + metadata: _MetadataType | None = None, + credentials: CallCredentials | None = None, # FIXME: optional bool seems weird, but that's what the docs suggest - wait_for_ready: bool | None = ..., - compression: Compression | None = ..., + wait_for_ready: bool | None = None, + compression: Compression | None = None, ) -> StreamStreamCall[_TRequest, _TResponse]: ... # Metadata: From 516089b0381a9529b9971d99ff1e41ef11e1bc21 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 22:33:01 +0000 Subject: [PATCH 05/17] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/grpcio/grpc/aio/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/grpcio/grpc/aio/__init__.pyi b/stubs/grpcio/grpc/aio/__init__.pyi index e82b0b1bd147..9f932d9f2c8c 100644 --- a/stubs/grpcio/grpc/aio/__init__.pyi +++ b/stubs/grpcio/grpc/aio/__init__.pyi @@ -216,7 +216,7 @@ class _DoneCallback(Generic[_TRequest, _TResponse]): class ServicerContext(Generic[_TRequest, _TResponse], metaclass=abc.ABCMeta): @abc.abstractmethod - async def abort(self, code: StatusCode, details: str = '', trailing_metadata: _MetadataType = ()) -> NoReturn: ... + async def abort(self, code: StatusCode, details: str = "", trailing_metadata: _MetadataType = ()) -> NoReturn: ... @abc.abstractmethod async def read(self) -> _TRequest: ... @abc.abstractmethod From b1caa0af590fc9a8cd7b18e5da4691378d98c6e7 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 18:40:30 -0400 Subject: [PATCH 06/17] Remove broken test --- stubs/grpcio-status/@tests/test_cases/check_status.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 stubs/grpcio-status/@tests/test_cases/check_status.py diff --git a/stubs/grpcio-status/@tests/test_cases/check_status.py b/stubs/grpcio-status/@tests/test_cases/check_status.py deleted file mode 100644 index b9e1776b68cf..000000000000 --- a/stubs/grpcio-status/@tests/test_cases/check_status.py +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -from grpc import Status -from grpc_status import to_status - -# XXX: to_status actually expects a "google.rpc.status.Status", -# but the stubs for that aren't present yet. -status: Status = to_status(None) From b4278414654d0b46504ae4a49186497841ed8e85 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 18:57:13 -0400 Subject: [PATCH 07/17] Add pyright stricter ignore entries --- pyrightconfig.stricter.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 1cba7f4512b1..bf06b241dacc 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -44,8 +44,11 @@ "stubs/gdb", "stubs/geopandas", "stubs/google-cloud-ndb", + "stubs/grpc-status/grpc_status/rpc_status.pyi", + "stubs/grpcio-channelz/grpc_channelz/v1", + "stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi", + "stubs/grpcio-reflection/grpc_reflection/v1alpha", "stubs/grpcio/grpc/__init__.pyi", - "stubs/grpcio/grpc_status/rpc_status.pyi", "stubs/hdbcli/hdbcli/dbapi.pyi", "stubs/html5lib", "stubs/httplib2", From 48cf819b0097ded0e78ef8698b557d1e5be44590 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 18:57:44 -0400 Subject: [PATCH 08/17] typo --- pyrightconfig.stricter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index bf06b241dacc..1017db408b67 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -44,10 +44,10 @@ "stubs/gdb", "stubs/geopandas", "stubs/google-cloud-ndb", - "stubs/grpc-status/grpc_status/rpc_status.pyi", "stubs/grpcio-channelz/grpc_channelz/v1", "stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi", "stubs/grpcio-reflection/grpc_reflection/v1alpha", + "stubs/grpcio-status/grpc_status/rpc_status.pyi", "stubs/grpcio/grpc/__init__.pyi", "stubs/hdbcli/hdbcli/dbapi.pyi", "stubs/html5lib", From a569cc4c118f4d09f41f5fd737cab31aac8ec42e Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 19:44:37 -0400 Subject: [PATCH 09/17] Missing a stub file --- stubs/grpcio-status/grpc_status/_async.pyi | 5 +++++ stubs/grpcio-status/grpc_status/rpc_status.pyi | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 stubs/grpcio-status/grpc_status/_async.pyi diff --git a/stubs/grpcio-status/grpc_status/_async.pyi b/stubs/grpcio-status/grpc_status/_async.pyi new file mode 100644 index 000000000000..a636b3f59f20 --- /dev/null +++ b/stubs/grpcio-status/grpc_status/_async.pyi @@ -0,0 +1,5 @@ +from _typeshed import Incomplete + +async def from_call(call) -> Incomplete | None: ... + +__all__ = ["from_call"] diff --git a/stubs/grpcio-status/grpc_status/rpc_status.pyi b/stubs/grpcio-status/grpc_status/rpc_status.pyi index 090716d5cfe9..e2e0204167f5 100644 --- a/stubs/grpcio-status/grpc_status/rpc_status.pyi +++ b/stubs/grpcio-status/grpc_status/rpc_status.pyi @@ -1,7 +1,11 @@ import grpc +from . import _async as aio + # Returns a google.rpc.status.Status message corresponding to a given grpc.Call. def from_call(call: grpc.Call): ... # Convert a google.rpc.status.Status message to grpc.Status. def to_status(status) -> grpc.Status: ... + +__all__ = ["from_call", "to_status", "aio"] From 21f5a90473c37ee4f9962b08397e2ae5f2ae746c Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Apr 2025 19:59:35 -0400 Subject: [PATCH 10/17] Exclude grpcio-status/grpc_status/_async.pyi from stricter --- pyrightconfig.stricter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 1017db408b67..f2aadeefc13d 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -47,7 +47,7 @@ "stubs/grpcio-channelz/grpc_channelz/v1", "stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi", "stubs/grpcio-reflection/grpc_reflection/v1alpha", - "stubs/grpcio-status/grpc_status/rpc_status.pyi", + "stubs/grpcio-status/grpc_status", "stubs/grpcio/grpc/__init__.pyi", "stubs/hdbcli/hdbcli/dbapi.pyi", "stubs/html5lib", From d82357e6c2cbc874ea9ad2217bad3bb198e1cf5b Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Apr 2025 12:38:48 -0400 Subject: [PATCH 11/17] fix some stubtest issues --- .../grpc_channelz/v1/channelz_pb2.pyi | 248 ++++++++++-------- .../grpc_health/v1/health_pb2.pyi | 38 ++- 2 files changed, 153 insertions(+), 133 deletions(-) diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi index f2423e34cefb..b867e0e8c0b8 100644 --- a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi @@ -1,14 +1,14 @@ from _typeshed import Incomplete from collections.abc import Iterable, Mapping -from typing import ClassVar +from typing import ClassVar, final -from google.protobuf import any_pb2, descriptor, duration_pb2, message as message, timestamp_pb2, wrappers_pb2 -from google.protobuf.internal import containers, enum_type_wrapper +from google._upb._message import Descriptor, FileDescriptor, MessageMeta +from google.protobuf import any_pb2, duration_pb2, message, timestamp_pb2, wrappers_pb2 +from google.protobuf.internal import containers -DESCRIPTOR: descriptor.FileDescriptor - -class Channel(message.Message): - __slots__ = ("ref", "data", "channel_ref", "subchannel_ref", "socket_ref") +DESCRIPTOR: FileDescriptor +@final +class Channel(message.Message, metaclass=MessageMeta): REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] CHANNEL_REF_FIELD_NUMBER: ClassVar[int] @@ -20,9 +20,10 @@ class Channel(message.Message): subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] def __init__(self, ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class Subchannel(message.Message): - __slots__ = ("ref", "data", "channel_ref", "subchannel_ref", "socket_ref") +@final +class Subchannel(message.Message, metaclass=MessageMeta): REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] CHANNEL_REF_FIELD_NUMBER: ClassVar[int] @@ -34,29 +35,24 @@ class Subchannel(message.Message): subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] def __init__(self, ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ..., data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... - -class ChannelConnectivityState(message.Message): - __slots__ = ("state",) - class State(int, metaclass=enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - UNKNOWN: ClassVar[ChannelConnectivityState.State] - IDLE: ClassVar[ChannelConnectivityState.State] - CONNECTING: ClassVar[ChannelConnectivityState.State] - READY: ClassVar[ChannelConnectivityState.State] - TRANSIENT_FAILURE: ClassVar[ChannelConnectivityState.State] - SHUTDOWN: ClassVar[ChannelConnectivityState.State] - UNKNOWN: ChannelConnectivityState.State - IDLE: ChannelConnectivityState.State - CONNECTING: ChannelConnectivityState.State - READY: ChannelConnectivityState.State - TRANSIENT_FAILURE: ChannelConnectivityState.State - SHUTDOWN: ChannelConnectivityState.State + DESCRIPTOR: Descriptor + +@final +class ChannelConnectivityState(message.Message, metaclass=MessageMeta): + State: Incomplete + UNKNOWN: Incomplete + IDLE: Incomplete + CONNECTING: Incomplete + READY: Incomplete + TRANSIENT_FAILURE: Incomplete + SHUTDOWN: Incomplete STATE_FIELD_NUMBER: ClassVar[int] - state: ChannelConnectivityState.State - def __init__(self, state: ChannelConnectivityState.State | str | None = ...) -> None: ... + state: Incomplete + def __init__(self, state: Incomplete | str | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class ChannelData(message.Message): - __slots__ = ("state", "target", "trace", "calls_started", "calls_succeeded", "calls_failed", "last_call_started_timestamp") +@final +class ChannelData(message.Message, metaclass=MessageMeta): STATE_FIELD_NUMBER: ClassVar[int] TARGET_FIELD_NUMBER: ClassVar[int] TRACE_FIELD_NUMBER: ClassVar[int] @@ -72,33 +68,30 @@ class ChannelData(message.Message): calls_failed: int last_call_started_timestamp: timestamp_pb2.Timestamp def __init__(self, state: ChannelConnectivityState | Mapping[Incomplete, Incomplete] | None = ..., target: str | None = ..., trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... - -class ChannelTraceEvent(message.Message): - __slots__ = ("description", "severity", "timestamp", "channel_ref", "subchannel_ref") - class Severity(int, metaclass=enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - CT_UNKNOWN: ClassVar[ChannelTraceEvent.Severity] - CT_INFO: ClassVar[ChannelTraceEvent.Severity] - CT_WARNING: ClassVar[ChannelTraceEvent.Severity] - CT_ERROR: ClassVar[ChannelTraceEvent.Severity] - CT_UNKNOWN: ChannelTraceEvent.Severity - CT_INFO: ChannelTraceEvent.Severity - CT_WARNING: ChannelTraceEvent.Severity - CT_ERROR: ChannelTraceEvent.Severity + DESCRIPTOR: Descriptor + +@final +class ChannelTraceEvent(message.Message, metaclass=MessageMeta): + Severity: Incomplete + CT_UNKNOWN: Incomplete + CT_INFO: Incomplete + CT_WARNING: Incomplete + CT_ERROR: Incomplete DESCRIPTION_FIELD_NUMBER: ClassVar[int] SEVERITY_FIELD_NUMBER: ClassVar[int] TIMESTAMP_FIELD_NUMBER: ClassVar[int] CHANNEL_REF_FIELD_NUMBER: ClassVar[int] SUBCHANNEL_REF_FIELD_NUMBER: ClassVar[int] description: str - severity: ChannelTraceEvent.Severity + severity: Incomplete timestamp: timestamp_pb2.Timestamp channel_ref: ChannelRef subchannel_ref: SubchannelRef - def __init__(self, description: str | None = ..., severity: ChannelTraceEvent.Severity | str | None = ..., timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., subchannel_ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__(self, description: str | None = ..., severity: Incomplete | str | None = ..., timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., subchannel_ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class ChannelTrace(message.Message): - __slots__ = ("num_events_logged", "creation_timestamp", "events") +@final +class ChannelTrace(message.Message, metaclass=MessageMeta): NUM_EVENTS_LOGGED_FIELD_NUMBER: ClassVar[int] CREATION_TIMESTAMP_FIELD_NUMBER: ClassVar[int] EVENTS_FIELD_NUMBER: ClassVar[int] @@ -106,41 +99,46 @@ class ChannelTrace(message.Message): creation_timestamp: timestamp_pb2.Timestamp events: containers.RepeatedCompositeFieldContainer[ChannelTraceEvent] def __init__(self, num_events_logged: int | None = ..., creation_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., events: Iterable[ChannelTraceEvent | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class ChannelRef(message.Message): - __slots__ = ("channel_id", "name") +@final +class ChannelRef(message.Message, metaclass=MessageMeta): CHANNEL_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] channel_id: int name: str def __init__(self, channel_id: int | None = ..., name: str | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class SubchannelRef(message.Message): - __slots__ = ("subchannel_id", "name") +@final +class SubchannelRef(message.Message, metaclass=MessageMeta): SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] subchannel_id: int name: str def __init__(self, subchannel_id: int | None = ..., name: str | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class SocketRef(message.Message): - __slots__ = ("socket_id", "name") +@final +class SocketRef(message.Message, metaclass=MessageMeta): SOCKET_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] socket_id: int name: str def __init__(self, socket_id: int | None = ..., name: str | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class ServerRef(message.Message): - __slots__ = ("server_id", "name") +@final +class ServerRef(message.Message, metaclass=MessageMeta): SERVER_ID_FIELD_NUMBER: ClassVar[int] NAME_FIELD_NUMBER: ClassVar[int] server_id: int name: str def __init__(self, server_id: int | None = ..., name: str | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class Server(message.Message): - __slots__ = ("ref", "data", "listen_socket") +@final +class Server(message.Message, metaclass=MessageMeta): REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] LISTEN_SOCKET_FIELD_NUMBER: ClassVar[int] @@ -148,9 +146,10 @@ class Server(message.Message): data: ServerData listen_socket: containers.RepeatedCompositeFieldContainer[SocketRef] def __init__(self, ref: ServerRef | Mapping[Incomplete, Incomplete] | None = ..., data: ServerData | Mapping[Incomplete, Incomplete] | None = ..., listen_socket: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class ServerData(message.Message): - __slots__ = ("trace", "calls_started", "calls_succeeded", "calls_failed", "last_call_started_timestamp") +@final +class ServerData(message.Message, metaclass=MessageMeta): TRACE_FIELD_NUMBER: ClassVar[int] CALLS_STARTED_FIELD_NUMBER: ClassVar[int] CALLS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] @@ -162,9 +161,10 @@ class ServerData(message.Message): calls_failed: int last_call_started_timestamp: timestamp_pb2.Timestamp def __init__(self, trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class Socket(message.Message): - __slots__ = ("ref", "data", "local", "remote", "security", "remote_name") +@final +class Socket(message.Message, metaclass=MessageMeta): REF_FIELD_NUMBER: ClassVar[int] DATA_FIELD_NUMBER: ClassVar[int] LOCAL_FIELD_NUMBER: ClassVar[int] @@ -178,9 +178,10 @@ class Socket(message.Message): security: Security remote_name: str def __init__(self, ref: SocketRef | Mapping[Incomplete, Incomplete] | None = ..., data: SocketData | Mapping[Incomplete, Incomplete] | None = ..., local: Address | Mapping[Incomplete, Incomplete] | None = ..., remote: Address | Mapping[Incomplete, Incomplete] | None = ..., security: Security | Mapping[Incomplete, Incomplete] | None = ..., remote_name: str | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class SocketData(message.Message): - __slots__ = ("streams_started", "streams_succeeded", "streams_failed", "messages_sent", "messages_received", "keep_alives_sent", "last_local_stream_created_timestamp", "last_remote_stream_created_timestamp", "last_message_sent_timestamp", "last_message_received_timestamp", "local_flow_control_window", "remote_flow_control_window", "option") +@final +class SocketData(message.Message, metaclass=MessageMeta): STREAMS_STARTED_FIELD_NUMBER: ClassVar[int] STREAMS_SUCCEEDED_FIELD_NUMBER: ClassVar[int] STREAMS_FAILED_FIELD_NUMBER: ClassVar[int] @@ -208,23 +209,24 @@ class SocketData(message.Message): remote_flow_control_window: wrappers_pb2.Int64Value option: containers.RepeatedCompositeFieldContainer[SocketOption] def __init__(self, streams_started: int | None = ..., streams_succeeded: int | None = ..., streams_failed: int | None = ..., messages_sent: int | None = ..., messages_received: int | None = ..., keep_alives_sent: int | None = ..., last_local_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_remote_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_message_sent_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_message_received_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., local_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., remote_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., option: Iterable[SocketOption | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class Address(message.Message): - __slots__ = ("tcpip_address", "uds_address", "other_address") - class TcpIpAddress(message.Message): - __slots__ = ("ip_address", "port") +@final +class Address(message.Message, metaclass=MessageMeta): + @final + class TcpIpAddress(message.Message, metaclass=MessageMeta): IP_ADDRESS_FIELD_NUMBER: ClassVar[int] PORT_FIELD_NUMBER: ClassVar[int] ip_address: bytes port: int def __init__(self, ip_address: bytes | None = ..., port: int | None = ...) -> None: ... - class UdsAddress(message.Message): - __slots__ = ("filename",) + @final + class UdsAddress(message.Message, metaclass=MessageMeta): FILENAME_FIELD_NUMBER: ClassVar[int] filename: str def __init__(self, filename: str | None = ...) -> None: ... - class OtherAddress(message.Message): - __slots__ = ("name", "value") + @final + class OtherAddress(message.Message, metaclass=MessageMeta): NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] name: str @@ -237,11 +239,12 @@ class Address(message.Message): uds_address: Address.UdsAddress other_address: Address.OtherAddress def __init__(self, tcpip_address: Address.TcpIpAddress | Mapping[Incomplete, Incomplete] | None = ..., uds_address: Address.UdsAddress | Mapping[Incomplete, Incomplete] | None = ..., other_address: Address.OtherAddress | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class Security(message.Message): - __slots__ = ("tls", "other") - class Tls(message.Message): - __slots__ = ("standard_name", "other_name", "local_certificate", "remote_certificate") +@final +class Security(message.Message, metaclass=MessageMeta): + @final + class Tls(message.Message, metaclass=MessageMeta): STANDARD_NAME_FIELD_NUMBER: ClassVar[int] OTHER_NAME_FIELD_NUMBER: ClassVar[int] LOCAL_CERTIFICATE_FIELD_NUMBER: ClassVar[int] @@ -251,8 +254,8 @@ class Security(message.Message): local_certificate: bytes remote_certificate: bytes def __init__(self, standard_name: str | None = ..., other_name: str | None = ..., local_certificate: bytes | None = ..., remote_certificate: bytes | None = ...) -> None: ... - class OtherSecurity(message.Message): - __slots__ = ("name", "value") + @final + class OtherSecurity(message.Message, metaclass=MessageMeta): NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] name: str @@ -263,9 +266,10 @@ class Security(message.Message): tls: Security.Tls other: Security.OtherSecurity def __init__(self, tls: Security.Tls | Mapping[Incomplete, Incomplete] | None = ..., other: Security.OtherSecurity | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class SocketOption(message.Message): - __slots__ = ("name", "value", "additional") +@final +class SocketOption(message.Message, metaclass=MessageMeta): NAME_FIELD_NUMBER: ClassVar[int] VALUE_FIELD_NUMBER: ClassVar[int] ADDITIONAL_FIELD_NUMBER: ClassVar[int] @@ -273,23 +277,26 @@ class SocketOption(message.Message): value: str additional: any_pb2.Any def __init__(self, name: str | None = ..., value: str | None = ..., additional: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class SocketOptionTimeout(message.Message): - __slots__ = ("duration",) +@final +class SocketOptionTimeout(message.Message, metaclass=MessageMeta): DURATION_FIELD_NUMBER: ClassVar[int] duration: duration_pb2.Duration def __init__(self, duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class SocketOptionLinger(message.Message): - __slots__ = ("active", "duration") +@final +class SocketOptionLinger(message.Message, metaclass=MessageMeta): ACTIVE_FIELD_NUMBER: ClassVar[int] DURATION_FIELD_NUMBER: ClassVar[int] active: bool duration: duration_pb2.Duration def __init__(self, active: bool = ..., duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class SocketOptionTcpInfo(message.Message): - __slots__ = ("tcpi_state", "tcpi_ca_state", "tcpi_retransmits", "tcpi_probes", "tcpi_backoff", "tcpi_options", "tcpi_snd_wscale", "tcpi_rcv_wscale", "tcpi_rto", "tcpi_ato", "tcpi_snd_mss", "tcpi_rcv_mss", "tcpi_unacked", "tcpi_sacked", "tcpi_lost", "tcpi_retrans", "tcpi_fackets", "tcpi_last_data_sent", "tcpi_last_ack_sent", "tcpi_last_data_recv", "tcpi_last_ack_recv", "tcpi_pmtu", "tcpi_rcv_ssthresh", "tcpi_rtt", "tcpi_rttvar", "tcpi_snd_ssthresh", "tcpi_snd_cwnd", "tcpi_advmss", "tcpi_reordering") +@final +class SocketOptionTcpInfo(message.Message, metaclass=MessageMeta): TCPI_STATE_FIELD_NUMBER: ClassVar[int] TCPI_CA_STATE_FIELD_NUMBER: ClassVar[int] TCPI_RETRANSMITS_FIELD_NUMBER: ClassVar[int] @@ -349,53 +356,60 @@ class SocketOptionTcpInfo(message.Message): tcpi_advmss: int tcpi_reordering: int def __init__(self, tcpi_state: int | None = ..., tcpi_ca_state: int | None = ..., tcpi_retransmits: int | None = ..., tcpi_probes: int | None = ..., tcpi_backoff: int | None = ..., tcpi_options: int | None = ..., tcpi_snd_wscale: int | None = ..., tcpi_rcv_wscale: int | None = ..., tcpi_rto: int | None = ..., tcpi_ato: int | None = ..., tcpi_snd_mss: int | None = ..., tcpi_rcv_mss: int | None = ..., tcpi_unacked: int | None = ..., tcpi_sacked: int | None = ..., tcpi_lost: int | None = ..., tcpi_retrans: int | None = ..., tcpi_fackets: int | None = ..., tcpi_last_data_sent: int | None = ..., tcpi_last_ack_sent: int | None = ..., tcpi_last_data_recv: int | None = ..., tcpi_last_ack_recv: int | None = ..., tcpi_pmtu: int | None = ..., tcpi_rcv_ssthresh: int | None = ..., tcpi_rtt: int | None = ..., tcpi_rttvar: int | None = ..., tcpi_snd_ssthresh: int | None = ..., tcpi_snd_cwnd: int | None = ..., tcpi_advmss: int | None = ..., tcpi_reordering: int | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetTopChannelsRequest(message.Message): - __slots__ = ("start_channel_id", "max_results") +@final +class GetTopChannelsRequest(message.Message, metaclass=MessageMeta): START_CHANNEL_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] start_channel_id: int max_results: int def __init__(self, start_channel_id: int | None = ..., max_results: int | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetTopChannelsResponse(message.Message): - __slots__ = ("channel", "end") +@final +class GetTopChannelsResponse(message.Message, metaclass=MessageMeta): CHANNEL_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] channel: containers.RepeatedCompositeFieldContainer[Channel] end: bool def __init__(self, channel: Iterable[Channel | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetServersRequest(message.Message): - __slots__ = ("start_server_id", "max_results") +@final +class GetServersRequest(message.Message, metaclass=MessageMeta): START_SERVER_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] start_server_id: int max_results: int def __init__(self, start_server_id: int | None = ..., max_results: int | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetServersResponse(message.Message): - __slots__ = ("server", "end") +@final +class GetServersResponse(message.Message, metaclass=MessageMeta): SERVER_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] server: containers.RepeatedCompositeFieldContainer[Server] end: bool def __init__(self, server: Iterable[Server | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetServerRequest(message.Message): - __slots__ = ("server_id",) +@final +class GetServerRequest(message.Message, metaclass=MessageMeta): SERVER_ID_FIELD_NUMBER: ClassVar[int] server_id: int def __init__(self, server_id: int | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetServerResponse(message.Message): - __slots__ = ("server",) +@final +class GetServerResponse(message.Message, metaclass=MessageMeta): SERVER_FIELD_NUMBER: ClassVar[int] server: Server def __init__(self, server: Server | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetServerSocketsRequest(message.Message): - __slots__ = ("server_id", "start_socket_id", "max_results") +@final +class GetServerSocketsRequest(message.Message, metaclass=MessageMeta): SERVER_ID_FIELD_NUMBER: ClassVar[int] START_SOCKET_ID_FIELD_NUMBER: ClassVar[int] MAX_RESULTS_FIELD_NUMBER: ClassVar[int] @@ -403,49 +417,57 @@ class GetServerSocketsRequest(message.Message): start_socket_id: int max_results: int def __init__(self, server_id: int | None = ..., start_socket_id: int | None = ..., max_results: int | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetServerSocketsResponse(message.Message): - __slots__ = ("socket_ref", "end") +@final +class GetServerSocketsResponse(message.Message, metaclass=MessageMeta): SOCKET_REF_FIELD_NUMBER: ClassVar[int] END_FIELD_NUMBER: ClassVar[int] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] end: bool def __init__(self, socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetChannelRequest(message.Message): - __slots__ = ("channel_id",) +@final +class GetChannelRequest(message.Message, metaclass=MessageMeta): CHANNEL_ID_FIELD_NUMBER: ClassVar[int] channel_id: int def __init__(self, channel_id: int | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetChannelResponse(message.Message): - __slots__ = ("channel",) +@final +class GetChannelResponse(message.Message, metaclass=MessageMeta): CHANNEL_FIELD_NUMBER: ClassVar[int] channel: Channel def __init__(self, channel: Channel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetSubchannelRequest(message.Message): - __slots__ = ("subchannel_id",) +@final +class GetSubchannelRequest(message.Message, metaclass=MessageMeta): SUBCHANNEL_ID_FIELD_NUMBER: ClassVar[int] subchannel_id: int def __init__(self, subchannel_id: int | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetSubchannelResponse(message.Message): - __slots__ = ("subchannel",) +@final +class GetSubchannelResponse(message.Message, metaclass=MessageMeta): SUBCHANNEL_FIELD_NUMBER: ClassVar[int] subchannel: Subchannel def __init__(self, subchannel: Subchannel | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetSocketRequest(message.Message): - __slots__ = ("socket_id", "summary") +@final +class GetSocketRequest(message.Message, metaclass=MessageMeta): SOCKET_ID_FIELD_NUMBER: ClassVar[int] SUMMARY_FIELD_NUMBER: ClassVar[int] socket_id: int summary: bool def __init__(self, socket_id: int | None = ..., summary: bool = ...) -> None: ... + DESCRIPTOR: Descriptor -class GetSocketResponse(message.Message): - __slots__ = ("socket",) +@final +class GetSocketResponse(message.Message, metaclass=MessageMeta): SOCKET_FIELD_NUMBER: ClassVar[int] socket: Socket def __init__(self, socket: Socket | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + DESCRIPTOR: Descriptor diff --git a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi index 8c094346f774..82191f79b659 100644 --- a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi +++ b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2.pyi @@ -1,28 +1,26 @@ -from typing import ClassVar +from _typeshed import Incomplete +from typing import ClassVar, final -from google.protobuf import descriptor, message -from google.protobuf.internal import enum_type_wrapper +from google._upb._message import Descriptor, FileDescriptor, MessageMeta +from google.protobuf import message -DESCRIPTOR: descriptor.FileDescriptor +DESCRIPTOR: FileDescriptor -class HealthCheckRequest(message.Message): - __slots__ = ("service",) +@final +class HealthCheckRequest(message.Message, metaclass=MessageMeta): SERVICE_FIELD_NUMBER: ClassVar[int] service: str def __init__(self, service: str | None = ...) -> None: ... + DESCRIPTOR: Descriptor -class HealthCheckResponse(message.Message): - __slots__ = ("status",) - class ServingStatus(int, metaclass=enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - UNKNOWN: ClassVar[HealthCheckResponse.ServingStatus] - SERVING: ClassVar[HealthCheckResponse.ServingStatus] - NOT_SERVING: ClassVar[HealthCheckResponse.ServingStatus] - SERVICE_UNKNOWN: ClassVar[HealthCheckResponse.ServingStatus] - UNKNOWN: HealthCheckResponse.ServingStatus - SERVING: HealthCheckResponse.ServingStatus - NOT_SERVING: HealthCheckResponse.ServingStatus - SERVICE_UNKNOWN: HealthCheckResponse.ServingStatus +@final +class HealthCheckResponse(message.Message, metaclass=MessageMeta): + ServingStatus: Incomplete + UNKNOWN: Incomplete + SERVING: Incomplete + NOT_SERVING: Incomplete + SERVICE_UNKNOWN: Incomplete STATUS_FIELD_NUMBER: ClassVar[int] - status: HealthCheckResponse.ServingStatus - def __init__(self, status: HealthCheckResponse.ServingStatus | str | None = ...) -> None: ... + status: Incomplete + def __init__(self, status: Incomplete | str | None = ...) -> None: ... + DESCRIPTOR: Descriptor From 20ea1952d9692fd01c12d68d55b5123d82f6cc35 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Apr 2025 13:24:33 -0400 Subject: [PATCH 12/17] Solve stubtest issues in protobuf --- stubs/protobuf/google/_upb/_message.pyi | 235 +++++++++--------------- 1 file changed, 91 insertions(+), 144 deletions(-) diff --git a/stubs/protobuf/google/_upb/_message.pyi b/stubs/protobuf/google/_upb/_message.pyi index 85d1e1d0f8fc..d36db814a03a 100644 --- a/stubs/protobuf/google/_upb/_message.pyi +++ b/stubs/protobuf/google/_upb/_message.pyi @@ -1,10 +1,12 @@ from _typeshed import Incomplete -from typing import ClassVar +from typing import ClassVar, final default_pool: DescriptorPool +@final class Arena: ... +@final class Descriptor: containing_type: Incomplete enum_types: Incomplete @@ -26,30 +28,30 @@ class Descriptor: nested_types_by_name: Incomplete oneofs: Incomplete oneofs_by_name: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def CopyToProto(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def CopyToProto(self, object, /): ... def EnumValueName(self, *args, **kwargs): ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def GetOptions(self): ... +@final class DescriptorPool: - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def Add(self, *args, **kwargs): ... # incomplete - def AddSerializedFile(self, *args, **kwargs): ... # incomplete - def FindAllExtensions(self, *args, **kwargs): ... # incomplete - def FindEnumTypeByName(self, *args, **kwargs): ... # incomplete - def FindExtensionByName(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def Add(self, object, /): ... + def AddSerializedFile(self, object, /): ... + def FindAllExtensions(self, object, /): ... + def FindEnumTypeByName(self, object, /): ... + def FindExtensionByName(self, object, /): ... def FindExtensionByNumber(self, *args, **kwargs): ... # incomplete - def FindFieldByName(self, *args, **kwargs): ... # incomplete - def FindFileByName(self, *args, **kwargs): ... # incomplete - def FindFileContainingSymbol(self, *args, **kwargs): ... # incomplete - def FindMessageTypeByName(self, *args, **kwargs): ... # incomplete - def FindMethodByName(self, *args, **kwargs): ... # incomplete - def FindOneofByName(self, *args, **kwargs): ... # incomplete - def FindServiceByName(self, *args, **kwargs): ... # incomplete - def SetFeatureSetDefaults(self, *args, **kwargs): ... # incomplete + def FindFieldByName(self, object, /): ... + def FindFileByName(self, object, /): ... + def FindFileContainingSymbol(self, object, /): ... + def FindMessageTypeByName(self, object, /): ... + def FindMethodByName(self, object, /): ... + def FindOneofByName(self, object, /): ... + def FindServiceByName(self, object, /): ... + def SetFeatureSetDefaults(self, object, /): ... +@final class EnumDescriptor: containing_type: Incomplete file: Incomplete @@ -60,21 +62,21 @@ class EnumDescriptor: values: Incomplete values_by_name: Incomplete values_by_number: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def CopyToProto(self, *args, **kwargs): ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def CopyToProto(self, object, /): ... + def GetOptions(self): ... +@final class EnumValueDescriptor: has_options: Incomplete index: Incomplete name: Incomplete number: Incomplete type: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def GetOptions(self): ... +@final class ExtensionDict: def __contains__(self, other) -> bool: ... def __delitem__(self, other) -> None: ... @@ -89,10 +91,12 @@ class ExtensionDict: def __ne__(self, other: object) -> bool: ... def __setitem__(self, index, object) -> None: ... +@final class ExtensionIterator: def __iter__(self): ... def __next__(self): ... +@final class FieldDescriptor: CPPTYPE_BOOL: ClassVar[int] = ... CPPTYPE_BYTES: ClassVar[int] = ... @@ -147,10 +151,10 @@ class FieldDescriptor: name: Incomplete number: Incomplete type: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def GetOptions(self): ... +@final class FileDescriptor: dependencies: Incomplete enum_types_by_name: Incomplete @@ -163,41 +167,42 @@ class FileDescriptor: public_dependencies: Incomplete serialized_pb: Incomplete services_by_name: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def CopyToProto(self, *args, **kwargs): ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def CopyToProto(self, object, /): ... + def GetOptions(self): ... +@final class MapIterator: def __iter__(self): ... def __next__(self): ... +@final class Message: Extensions: Incomplete - def __init__(self, *args, **kwargs) -> None: ... # incomplete - def ByteSize(self, *args, **kwargs): ... # incomplete - def Clear(self, *args, **kwargs): ... # incomplete - def ClearExtension(self, *args, **kwargs): ... # incomplete - def ClearField(self, *args, **kwargs): ... # incomplete - def CopyFrom(self, *args, **kwargs): ... # incomplete - def DiscardUnknownFields(self, *args, **kwargs): ... # incomplete - def FindInitializationErrors(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete # incomplete + def ByteSize(self): ... + def Clear(self): ... + def ClearExtension(self, object, /): ... + def ClearField(self, object, /): ... + def CopyFrom(self, object, /): ... + def DiscardUnknownFields(self): ... + def FindInitializationErrors(self): ... @classmethod - def FromString(cls, *args, **kwargs): ... # incomplete - def HasExtension(self, *args, **kwargs): ... # incomplete - def HasField(self, *args, **kwargs): ... # incomplete + def FromString(cls, object, /): ... + def HasExtension(self, object, /): ... + def HasField(self, object, /): ... def IsInitialized(self, *args, **kwargs): ... # incomplete - def ListFields(self, *args, **kwargs): ... # incomplete - def MergeFrom(self, *args, **kwargs): ... # incomplete - def MergeFromString(self, *args, **kwargs): ... # incomplete - def ParseFromString(self, *args, **kwargs): ... # incomplete + def ListFields(self): ... + def MergeFrom(self, object, /): ... + def MergeFromString(self, object, /): ... + def ParseFromString(self, object, /): ... def SerializePartialToString(self, *args, **kwargs): ... # incomplete def SerializeToString(self, *args, **kwargs): ... # incomplete - def SetInParent(self, *args, **kwargs): ... # incomplete - def UnknownFields(self, *args, **kwargs): ... # incomplete - def WhichOneof(self, *args, **kwargs): ... # incomplete + def SetInParent(self): ... + def UnknownFields(self): ... + def WhichOneof(self, object, /): ... def __contains__(self, other) -> bool: ... - def __deepcopy__(self): ... + def __deepcopy__(self, memo=None): ... def __delattr__(self, name): ... def __eq__(self, other: object) -> bool: ... def __ge__(self, other: object) -> bool: ... @@ -208,10 +213,10 @@ class Message: def __ne__(self, other: object) -> bool: ... def __setattr__(self, name, value): ... -class MessageMeta(type): - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete +@final +class MessageMeta(type): ... +@final class MethodDescriptor: client_streaming: Incomplete containing_service: Incomplete @@ -221,11 +226,11 @@ class MethodDescriptor: name: Incomplete output_type: Incomplete server_streaming: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def CopyToProto(self, *args, **kwargs): ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def CopyToProto(self, object, /): ... + def GetOptions(self): ... +@final class OneofDescriptor: containing_type: Incomplete fields: Incomplete @@ -233,23 +238,22 @@ class OneofDescriptor: has_options: Incomplete index: Incomplete name: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def GetOptions(self): ... +@final class RepeatedCompositeContainer: - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def MergeFrom(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def MergeFrom(self, object, /): ... def add(self, *args, **kwargs): ... # incomplete - def append(self, *args, **kwargs): ... # incomplete - def extend(self, *args, **kwargs): ... # incomplete + def append(self, object, /): ... + def extend(self, object, /): ... def insert(self, *args, **kwargs): ... # incomplete def pop(self, *args, **kwargs): ... # incomplete - def remove(self, *args, **kwargs): ... # incomplete - def reverse(self, *args, **kwargs): ... # incomplete + def remove(self, object, /): ... + def reverse(self): ... def sort(self, *args, **kwargs): ... # incomplete - def __deepcopy__(self): ... + def __deepcopy__(self, memo=None): ... def __delitem__(self, other) -> None: ... def __eq__(self, other: object) -> bool: ... def __ge__(self, other: object) -> bool: ... @@ -262,18 +266,18 @@ class RepeatedCompositeContainer: def __ne__(self, other: object) -> bool: ... def __setitem__(self, index, object) -> None: ... +@final class RepeatedScalarContainer: - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def MergeFrom(self, *args, **kwargs): ... # incomplete - def append(self, *args, **kwargs): ... # incomplete - def extend(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def MergeFrom(self, object, /): ... + def append(self, object, /): ... + def extend(self, object, /): ... def insert(self, *args, **kwargs): ... # incomplete def pop(self, *args, **kwargs): ... # incomplete - def remove(self, *args, **kwargs): ... # incomplete - def reverse(self, *args, **kwargs): ... # incomplete + def remove(self, object, /): ... + def reverse(self): ... def sort(self, *args, **kwargs): ... # incomplete - def __deepcopy__(self): ... + def __deepcopy__(self, memo=None): ... def __delitem__(self, other) -> None: ... def __eq__(self, other: object) -> bool: ... def __ge__(self, other: object) -> bool: ... @@ -287,6 +291,7 @@ class RepeatedScalarContainer: def __reduce__(self): ... def __setitem__(self, index, object) -> None: ... +@final class ServiceDescriptor: file: Incomplete full_name: Incomplete @@ -294,74 +299,16 @@ class ServiceDescriptor: methods: Incomplete methods_by_name: Incomplete name: Incomplete - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete - def CopyToProto(self, *args, **kwargs): ... # incomplete - def FindMethodByName(self, *args, **kwargs): ... # incomplete - def GetOptions(self, *args, **kwargs): ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete + def CopyToProto(self, object, /): ... + def FindMethodByName(self, object, /): ... + def GetOptions(self): ... +@final class UnknownFieldSet: - @classmethod - def __init__(cls, *args, **kwargs) -> None: ... # incomplete + def __init__(self, *args, **kwargs) -> None: ... # incomplete def __getitem__(self, index): ... def __hash__(self) -> int: ... def __len__(self) -> int: ... -class _ByNameIterator: - def __iter__(self): ... - def __next__(self): ... - -class _ByNameMap: - def get(self, *args, **kwargs): ... # incomplete - def items(self, *args, **kwargs): ... # incomplete - def keys(self, *args, **kwargs): ... # incomplete - def values(self, *args, **kwargs): ... # incomplete - def __contains__(self, other) -> bool: ... - def __delitem__(self, other) -> None: ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: object) -> bool: ... - def __getitem__(self, index): ... - def __gt__(self, other: object) -> bool: ... - def __iter__(self): ... - def __le__(self, other: object) -> bool: ... - def __len__(self) -> int: ... - def __lt__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... - def __setitem__(self, index, object) -> None: ... - -class _ByNumberIterator: - def __iter__(self): ... - def __next__(self): ... - -class _ByNumberMap: - def get(self, *args, **kwargs): ... # incomplete - def items(self, *args, **kwargs): ... # incomplete - def keys(self, *args, **kwargs): ... # incomplete - def values(self, *args, **kwargs): ... # incomplete - def __contains__(self, other) -> bool: ... - def __delitem__(self, other) -> None: ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: object) -> bool: ... - def __getitem__(self, index): ... - def __gt__(self, other: object) -> bool: ... - def __iter__(self): ... - def __le__(self, other: object) -> bool: ... - def __len__(self) -> int: ... - def __lt__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... - def __setitem__(self, index, object) -> None: ... - -class _GenericSequence: - def append(self, *args, **kwargs): ... # incomplete - def count(self, *args, **kwargs): ... # incomplete - def index(self, *args, **kwargs): ... # incomplete - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: object) -> bool: ... - def __getitem__(self, index): ... - def __gt__(self, other: object) -> bool: ... - def __le__(self, other: object) -> bool: ... - def __len__(self) -> int: ... - def __lt__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... - -def SetAllowOversizeProtos(*args, **kwargs): ... # incomplete +def SetAllowOversizeProtos(object, /): ... # incomplete From 00add8990ab1417459c57fb070ac748471ba3bf8 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Apr 2025 13:26:35 -0400 Subject: [PATCH 13/17] Fix pytype --- stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi | 2 +- .../grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi | 4 +--- .../grpc_reflection/v1alpha/reflection_pb2_grpc.pyi | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi index bcb43216421e..bd6f78fecf4d 100644 --- a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2_grpc.pyi @@ -4,7 +4,7 @@ from typing import Final import grpc GRPC_GENERATED_VERSION: Final[str] -GRPC_VERSION: Final = grpc.__version__ +GRPC_VERSION: Final[str] class ChannelzStub: GetTopChannels: Incomplete diff --git a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi index eea9f65bacd9..8170664f0cb1 100644 --- a/stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi +++ b/stubs/grpcio-health-checking/grpc_health/v1/health_pb2_grpc.pyi @@ -1,9 +1,7 @@ from typing import Final -import grpc - GRPC_GENERATED_VERSION: Final[str] -GRPC_VERSION: Final = grpc.__version__ +GRPC_VERSION: Final[str] class HealthStub: def __init__(self, channel) -> None: ... diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi index 86d0a268e1ed..31b983b4f82c 100644 --- a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi @@ -4,7 +4,7 @@ from typing import Final import grpc GRPC_GENERATED_VERSION: Final[str] -GRPC_VERSION: Final = grpc.__version__ +GRPC_VERSION: Final[str] class ServerReflectionStub: ServerReflectionInfo: Incomplete From 24dda9f54004b6c46522ecbfed0a46c4ec5f0234 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Apr 2025 16:48:46 -0400 Subject: [PATCH 14/17] Remove __hash__ function --- stubs/protobuf/google/_upb/_message.pyi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stubs/protobuf/google/_upb/_message.pyi b/stubs/protobuf/google/_upb/_message.pyi index d36db814a03a..bb188bcbf4f1 100644 --- a/stubs/protobuf/google/_upb/_message.pyi +++ b/stubs/protobuf/google/_upb/_message.pyi @@ -207,7 +207,6 @@ class Message: def __eq__(self, other: object) -> bool: ... def __ge__(self, other: object) -> bool: ... def __gt__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... def __le__(self, other: object) -> bool: ... def __lt__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... @@ -259,7 +258,6 @@ class RepeatedCompositeContainer: def __ge__(self, other: object) -> bool: ... def __getitem__(self, index): ... def __gt__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... def __le__(self, other: object) -> bool: ... def __len__(self) -> int: ... def __lt__(self, other: object) -> bool: ... @@ -283,7 +281,6 @@ class RepeatedScalarContainer: def __ge__(self, other: object) -> bool: ... def __getitem__(self, index): ... def __gt__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... def __le__(self, other: object) -> bool: ... def __len__(self) -> int: ... def __lt__(self, other: object) -> bool: ... @@ -308,7 +305,6 @@ class ServiceDescriptor: class UnknownFieldSet: def __init__(self, *args, **kwargs) -> None: ... # incomplete def __getitem__(self, index): ... - def __hash__(self) -> int: ... def __len__(self) -> int: ... def SetAllowOversizeProtos(object, /): ... # incomplete From 882bac4c66ac2fc66b726a1c9aa8c3ba092d2e64 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 3 May 2025 13:16:57 -0400 Subject: [PATCH 15/17] Update pyrightconfig.stricter.json --- pyrightconfig.stricter.json | 1 - 1 file changed, 1 deletion(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index da78d41af057..74196972b4ee 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -49,7 +49,6 @@ "stubs/grpcio-reflection/grpc_reflection/v1alpha", "stubs/grpcio-status/grpc_status", "stubs/grpcio/grpc/__init__.pyi", - "stubs/grpcio/grpc_status/rpc_status.pyi", "stubs/hdbcli/hdbcli/dbapi.pyi", "stubs/html5lib", "stubs/httplib2", From 4e2a2426c322f21f18644e88cab6f99d54910999 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 14:34:23 +0000 Subject: [PATCH 16/17] [pre-commit.ci] auto fixes from pre-commit.com hooks --- .../grpc_channelz/v1/channelz_pb2.pyi | 163 ++++++++++++++++-- .../v1alpha/reflection_pb2.pyi | 21 ++- 2 files changed, 166 insertions(+), 18 deletions(-) diff --git a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi index b867e0e8c0b8..262fa0f3f89c 100644 --- a/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi +++ b/stubs/grpcio-channelz/grpc_channelz/v1/channelz_pb2.pyi @@ -7,6 +7,7 @@ from google.protobuf import any_pb2, duration_pb2, message, timestamp_pb2, wrapp from google.protobuf.internal import containers DESCRIPTOR: FileDescriptor + @final class Channel(message.Message, metaclass=MessageMeta): REF_FIELD_NUMBER: ClassVar[int] @@ -19,7 +20,14 @@ class Channel(message.Message, metaclass=MessageMeta): channel_ref: containers.RepeatedCompositeFieldContainer[ChannelRef] subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] - def __init__(self, ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + def __init__( + self, + ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., + data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., + channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., + subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., + socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -34,7 +42,14 @@ class Subchannel(message.Message, metaclass=MessageMeta): channel_ref: containers.RepeatedCompositeFieldContainer[ChannelRef] subchannel_ref: containers.RepeatedCompositeFieldContainer[SubchannelRef] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] - def __init__(self, ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ..., data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + def __init__( + self, + ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ..., + data: ChannelData | Mapping[Incomplete, Incomplete] | None = ..., + channel_ref: Iterable[ChannelRef | Mapping[Incomplete, Incomplete]] | None = ..., + subchannel_ref: Iterable[SubchannelRef | Mapping[Incomplete, Incomplete]] | None = ..., + socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -67,7 +82,16 @@ class ChannelData(message.Message, metaclass=MessageMeta): calls_succeeded: int calls_failed: int last_call_started_timestamp: timestamp_pb2.Timestamp - def __init__(self, state: ChannelConnectivityState | Mapping[Incomplete, Incomplete] | None = ..., target: str | None = ..., trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, + state: ChannelConnectivityState | Mapping[Incomplete, Incomplete] | None = ..., + target: str | None = ..., + trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., + calls_started: int | None = ..., + calls_succeeded: int | None = ..., + calls_failed: int | None = ..., + last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -87,7 +111,14 @@ class ChannelTraceEvent(message.Message, metaclass=MessageMeta): timestamp: timestamp_pb2.Timestamp channel_ref: ChannelRef subchannel_ref: SubchannelRef - def __init__(self, description: str | None = ..., severity: Incomplete | str | None = ..., timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., channel_ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., subchannel_ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, + description: str | None = ..., + severity: Incomplete | str | None = ..., + timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + channel_ref: ChannelRef | Mapping[Incomplete, Incomplete] | None = ..., + subchannel_ref: SubchannelRef | Mapping[Incomplete, Incomplete] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -98,7 +129,12 @@ class ChannelTrace(message.Message, metaclass=MessageMeta): num_events_logged: int creation_timestamp: timestamp_pb2.Timestamp events: containers.RepeatedCompositeFieldContainer[ChannelTraceEvent] - def __init__(self, num_events_logged: int | None = ..., creation_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., events: Iterable[ChannelTraceEvent | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + def __init__( + self, + num_events_logged: int | None = ..., + creation_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + events: Iterable[ChannelTraceEvent | Mapping[Incomplete, Incomplete]] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -145,7 +181,12 @@ class Server(message.Message, metaclass=MessageMeta): ref: ServerRef data: ServerData listen_socket: containers.RepeatedCompositeFieldContainer[SocketRef] - def __init__(self, ref: ServerRef | Mapping[Incomplete, Incomplete] | None = ..., data: ServerData | Mapping[Incomplete, Incomplete] | None = ..., listen_socket: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + def __init__( + self, + ref: ServerRef | Mapping[Incomplete, Incomplete] | None = ..., + data: ServerData | Mapping[Incomplete, Incomplete] | None = ..., + listen_socket: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -160,7 +201,14 @@ class ServerData(message.Message, metaclass=MessageMeta): calls_succeeded: int calls_failed: int last_call_started_timestamp: timestamp_pb2.Timestamp - def __init__(self, trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., calls_started: int | None = ..., calls_succeeded: int | None = ..., calls_failed: int | None = ..., last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, + trace: ChannelTrace | Mapping[Incomplete, Incomplete] | None = ..., + calls_started: int | None = ..., + calls_succeeded: int | None = ..., + calls_failed: int | None = ..., + last_call_started_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -177,7 +225,15 @@ class Socket(message.Message, metaclass=MessageMeta): remote: Address security: Security remote_name: str - def __init__(self, ref: SocketRef | Mapping[Incomplete, Incomplete] | None = ..., data: SocketData | Mapping[Incomplete, Incomplete] | None = ..., local: Address | Mapping[Incomplete, Incomplete] | None = ..., remote: Address | Mapping[Incomplete, Incomplete] | None = ..., security: Security | Mapping[Incomplete, Incomplete] | None = ..., remote_name: str | None = ...) -> None: ... + def __init__( + self, + ref: SocketRef | Mapping[Incomplete, Incomplete] | None = ..., + data: SocketData | Mapping[Incomplete, Incomplete] | None = ..., + local: Address | Mapping[Incomplete, Incomplete] | None = ..., + remote: Address | Mapping[Incomplete, Incomplete] | None = ..., + security: Security | Mapping[Incomplete, Incomplete] | None = ..., + remote_name: str | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -208,7 +264,22 @@ class SocketData(message.Message, metaclass=MessageMeta): local_flow_control_window: wrappers_pb2.Int64Value remote_flow_control_window: wrappers_pb2.Int64Value option: containers.RepeatedCompositeFieldContainer[SocketOption] - def __init__(self, streams_started: int | None = ..., streams_succeeded: int | None = ..., streams_failed: int | None = ..., messages_sent: int | None = ..., messages_received: int | None = ..., keep_alives_sent: int | None = ..., last_local_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_remote_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_message_sent_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., last_message_received_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., local_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., remote_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., option: Iterable[SocketOption | Mapping[Incomplete, Incomplete]] | None = ...) -> None: ... + def __init__( + self, + streams_started: int | None = ..., + streams_succeeded: int | None = ..., + streams_failed: int | None = ..., + messages_sent: int | None = ..., + messages_received: int | None = ..., + keep_alives_sent: int | None = ..., + last_local_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + last_remote_stream_created_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + last_message_sent_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + last_message_received_timestamp: timestamp_pb2.Timestamp | Mapping[Incomplete, Incomplete] | None = ..., + local_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., + remote_flow_control_window: wrappers_pb2.Int64Value | Mapping[Incomplete, Incomplete] | None = ..., + option: Iterable[SocketOption | Mapping[Incomplete, Incomplete]] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -220,11 +291,13 @@ class Address(message.Message, metaclass=MessageMeta): ip_address: bytes port: int def __init__(self, ip_address: bytes | None = ..., port: int | None = ...) -> None: ... + @final class UdsAddress(message.Message, metaclass=MessageMeta): FILENAME_FIELD_NUMBER: ClassVar[int] filename: str def __init__(self, filename: str | None = ...) -> None: ... + @final class OtherAddress(message.Message, metaclass=MessageMeta): NAME_FIELD_NUMBER: ClassVar[int] @@ -232,13 +305,19 @@ class Address(message.Message, metaclass=MessageMeta): name: str value: any_pb2.Any def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + TCPIP_ADDRESS_FIELD_NUMBER: ClassVar[int] UDS_ADDRESS_FIELD_NUMBER: ClassVar[int] OTHER_ADDRESS_FIELD_NUMBER: ClassVar[int] tcpip_address: Address.TcpIpAddress uds_address: Address.UdsAddress other_address: Address.OtherAddress - def __init__(self, tcpip_address: Address.TcpIpAddress | Mapping[Incomplete, Incomplete] | None = ..., uds_address: Address.UdsAddress | Mapping[Incomplete, Incomplete] | None = ..., other_address: Address.OtherAddress | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, + tcpip_address: Address.TcpIpAddress | Mapping[Incomplete, Incomplete] | None = ..., + uds_address: Address.UdsAddress | Mapping[Incomplete, Incomplete] | None = ..., + other_address: Address.OtherAddress | Mapping[Incomplete, Incomplete] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -253,7 +332,14 @@ class Security(message.Message, metaclass=MessageMeta): other_name: str local_certificate: bytes remote_certificate: bytes - def __init__(self, standard_name: str | None = ..., other_name: str | None = ..., local_certificate: bytes | None = ..., remote_certificate: bytes | None = ...) -> None: ... + def __init__( + self, + standard_name: str | None = ..., + other_name: str | None = ..., + local_certificate: bytes | None = ..., + remote_certificate: bytes | None = ..., + ) -> None: ... + @final class OtherSecurity(message.Message, metaclass=MessageMeta): NAME_FIELD_NUMBER: ClassVar[int] @@ -261,11 +347,16 @@ class Security(message.Message, metaclass=MessageMeta): name: str value: any_pb2.Any def __init__(self, name: str | None = ..., value: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + TLS_FIELD_NUMBER: ClassVar[int] OTHER_FIELD_NUMBER: ClassVar[int] tls: Security.Tls other: Security.OtherSecurity - def __init__(self, tls: Security.Tls | Mapping[Incomplete, Incomplete] | None = ..., other: Security.OtherSecurity | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, + tls: Security.Tls | Mapping[Incomplete, Incomplete] | None = ..., + other: Security.OtherSecurity | Mapping[Incomplete, Incomplete] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -276,7 +367,12 @@ class SocketOption(message.Message, metaclass=MessageMeta): name: str value: str additional: any_pb2.Any - def __init__(self, name: str | None = ..., value: str | None = ..., additional: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, + name: str | None = ..., + value: str | None = ..., + additional: any_pb2.Any | Mapping[Incomplete, Incomplete] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -292,7 +388,9 @@ class SocketOptionLinger(message.Message, metaclass=MessageMeta): DURATION_FIELD_NUMBER: ClassVar[int] active: bool duration: duration_pb2.Duration - def __init__(self, active: bool = ..., duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, active: bool = ..., duration: duration_pb2.Duration | Mapping[Incomplete, Incomplete] | None = ... + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -355,7 +453,38 @@ class SocketOptionTcpInfo(message.Message, metaclass=MessageMeta): tcpi_snd_cwnd: int tcpi_advmss: int tcpi_reordering: int - def __init__(self, tcpi_state: int | None = ..., tcpi_ca_state: int | None = ..., tcpi_retransmits: int | None = ..., tcpi_probes: int | None = ..., tcpi_backoff: int | None = ..., tcpi_options: int | None = ..., tcpi_snd_wscale: int | None = ..., tcpi_rcv_wscale: int | None = ..., tcpi_rto: int | None = ..., tcpi_ato: int | None = ..., tcpi_snd_mss: int | None = ..., tcpi_rcv_mss: int | None = ..., tcpi_unacked: int | None = ..., tcpi_sacked: int | None = ..., tcpi_lost: int | None = ..., tcpi_retrans: int | None = ..., tcpi_fackets: int | None = ..., tcpi_last_data_sent: int | None = ..., tcpi_last_ack_sent: int | None = ..., tcpi_last_data_recv: int | None = ..., tcpi_last_ack_recv: int | None = ..., tcpi_pmtu: int | None = ..., tcpi_rcv_ssthresh: int | None = ..., tcpi_rtt: int | None = ..., tcpi_rttvar: int | None = ..., tcpi_snd_ssthresh: int | None = ..., tcpi_snd_cwnd: int | None = ..., tcpi_advmss: int | None = ..., tcpi_reordering: int | None = ...) -> None: ... + def __init__( + self, + tcpi_state: int | None = ..., + tcpi_ca_state: int | None = ..., + tcpi_retransmits: int | None = ..., + tcpi_probes: int | None = ..., + tcpi_backoff: int | None = ..., + tcpi_options: int | None = ..., + tcpi_snd_wscale: int | None = ..., + tcpi_rcv_wscale: int | None = ..., + tcpi_rto: int | None = ..., + tcpi_ato: int | None = ..., + tcpi_snd_mss: int | None = ..., + tcpi_rcv_mss: int | None = ..., + tcpi_unacked: int | None = ..., + tcpi_sacked: int | None = ..., + tcpi_lost: int | None = ..., + tcpi_retrans: int | None = ..., + tcpi_fackets: int | None = ..., + tcpi_last_data_sent: int | None = ..., + tcpi_last_ack_sent: int | None = ..., + tcpi_last_data_recv: int | None = ..., + tcpi_last_ack_recv: int | None = ..., + tcpi_pmtu: int | None = ..., + tcpi_rcv_ssthresh: int | None = ..., + tcpi_rtt: int | None = ..., + tcpi_rttvar: int | None = ..., + tcpi_snd_ssthresh: int | None = ..., + tcpi_snd_cwnd: int | None = ..., + tcpi_advmss: int | None = ..., + tcpi_reordering: int | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final @@ -425,7 +554,9 @@ class GetServerSocketsResponse(message.Message, metaclass=MessageMeta): END_FIELD_NUMBER: ClassVar[int] socket_ref: containers.RepeatedCompositeFieldContainer[SocketRef] end: bool - def __init__(self, socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ...) -> None: ... + def __init__( + self, socket_ref: Iterable[SocketRef | Mapping[Incomplete, Incomplete]] | None = ..., end: bool = ... + ) -> None: ... DESCRIPTOR: Descriptor @final diff --git a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi index 35eff35cdb30..94f335771385 100644 --- a/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi +++ b/stubs/grpcio-reflection/grpc_reflection/v1alpha/reflection_pb2.pyi @@ -22,8 +22,17 @@ class ServerReflectionRequest(message.Message, metaclass=MessageMeta): file_containing_extension: ExtensionRequest all_extension_numbers_of_type: str list_services: str - def __init__(self, host: str | None = ..., file_by_filename: str | None = ..., file_containing_symbol: str | None = ..., file_containing_extension: ExtensionRequest | Mapping[Incomplete, Incomplete] | None = ..., all_extension_numbers_of_type: str | None = ..., list_services: str | None = ...) -> None: ... + def __init__( + self, + host: str | None = ..., + file_by_filename: str | None = ..., + file_containing_symbol: str | None = ..., + file_containing_extension: ExtensionRequest | Mapping[Incomplete, Incomplete] | None = ..., + all_extension_numbers_of_type: str | None = ..., + list_services: str | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor + @final class ExtensionRequest(message.Message, metaclass=MessageMeta): CONTAINING_TYPE_FIELD_NUMBER: ClassVar[int] @@ -47,7 +56,15 @@ class ServerReflectionResponse(message.Message, metaclass=MessageMeta): all_extension_numbers_response: ExtensionNumberResponse list_services_response: ListServiceResponse error_response: ErrorResponse - def __init__(self, valid_host: str | None = ..., original_request: ServerReflectionRequest | Mapping[Incomplete, Incomplete] | None = ..., file_descriptor_response: FileDescriptorResponse | Mapping[Incomplete, Incomplete] | None = ..., all_extension_numbers_response: ExtensionNumberResponse | Mapping[Incomplete, Incomplete] | None = ..., list_services_response: ListServiceResponse | Mapping[Incomplete, Incomplete] | None = ..., error_response: ErrorResponse | Mapping[Incomplete, Incomplete] | None = ...) -> None: ... + def __init__( + self, + valid_host: str | None = ..., + original_request: ServerReflectionRequest | Mapping[Incomplete, Incomplete] | None = ..., + file_descriptor_response: FileDescriptorResponse | Mapping[Incomplete, Incomplete] | None = ..., + all_extension_numbers_response: ExtensionNumberResponse | Mapping[Incomplete, Incomplete] | None = ..., + list_services_response: ListServiceResponse | Mapping[Incomplete, Incomplete] | None = ..., + error_response: ErrorResponse | Mapping[Incomplete, Incomplete] | None = ..., + ) -> None: ... DESCRIPTOR: Descriptor @final From 7eb5b319f55fc647d38c67a5b89f8020a6f8bf98 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 5 May 2025 10:34:43 -0400 Subject: [PATCH 17/17] Remove leftover files that have been moved --- stubs/grpcio/grpc_channelz/v1/_async.pyi | 19 ------------ .../grpcio/grpc_reflection/v1alpha/_async.pyi | 11 ------- .../proto_reflection_descriptor_database.pyi | 11 ------- .../v1alpha/reflection_pb2_grpc.pyi | 31 ------------------- stubs/grpcio/grpc_status/_async.pyi | 5 --- 5 files changed, 77 deletions(-) delete mode 100644 stubs/grpcio/grpc_channelz/v1/_async.pyi delete mode 100644 stubs/grpcio/grpc_reflection/v1alpha/_async.pyi delete mode 100644 stubs/grpcio/grpc_reflection/v1alpha/proto_reflection_descriptor_database.pyi delete mode 100644 stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi delete mode 100644 stubs/grpcio/grpc_status/_async.pyi diff --git a/stubs/grpcio/grpc_channelz/v1/_async.pyi b/stubs/grpcio/grpc_channelz/v1/_async.pyi deleted file mode 100644 index 87aa2bf125d1..000000000000 --- a/stubs/grpcio/grpc_channelz/v1/_async.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from grpc_channelz.v1 import channelz_pb2, channelz_pb2_grpc - -class ChannelzServicer(channelz_pb2_grpc.ChannelzServicer): - @staticmethod - async def GetTopChannels(request: channelz_pb2.GetTopChannelsRequest, context) -> channelz_pb2.GetTopChannelsResponse: ... - @staticmethod - async def GetServers(request: channelz_pb2.GetServersRequest, context) -> channelz_pb2.GetServersResponse: ... - @staticmethod - async def GetServer(request: channelz_pb2.GetServerRequest, context) -> channelz_pb2.GetServerResponse: ... - @staticmethod - async def GetServerSockets( - request: channelz_pb2.GetServerSocketsRequest, context - ) -> channelz_pb2.GetServerSocketsResponse: ... - @staticmethod - async def GetChannel(request: channelz_pb2.GetChannelRequest, context) -> channelz_pb2.GetChannelResponse: ... - @staticmethod - async def GetSubchannel(request: channelz_pb2.GetSubchannelRequest, context) -> channelz_pb2.GetSubchannelResponse: ... - @staticmethod - async def GetSocket(request: channelz_pb2.GetSocketRequest, context) -> channelz_pb2.GetSocketResponse: ... diff --git a/stubs/grpcio/grpc_reflection/v1alpha/_async.pyi b/stubs/grpcio/grpc_reflection/v1alpha/_async.pyi deleted file mode 100644 index 39fa94fe1d91..000000000000 --- a/stubs/grpcio/grpc_reflection/v1alpha/_async.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import AsyncIterable - -from grpc_reflection.v1alpha import reflection_pb2 -from grpc_reflection.v1alpha._base import BaseReflectionServicer - -class ReflectionServicer(BaseReflectionServicer): - async def ServerReflectionInfo( - self, request_iterator: AsyncIterable[reflection_pb2.ServerReflectionRequest], unused_context - ) -> AsyncIterable[reflection_pb2.ServerReflectionResponse]: ... - -__all__ = ["ReflectionServicer"] diff --git a/stubs/grpcio/grpc_reflection/v1alpha/proto_reflection_descriptor_database.pyi b/stubs/grpcio/grpc_reflection/v1alpha/proto_reflection_descriptor_database.pyi deleted file mode 100644 index e41b1edb0bab..000000000000 --- a/stubs/grpcio/grpc_reflection/v1alpha/proto_reflection_descriptor_database.pyi +++ /dev/null @@ -1,11 +0,0 @@ -import grpc -from google.protobuf.descriptor_database import DescriptorDatabase -from google.protobuf.descriptor_pb2 import FileDescriptorProto - -class ProtoReflectionDescriptorDatabase(DescriptorDatabase): - def __init__(self, channel: grpc.Channel) -> None: ... - def get_services(self) -> list[str]: ... - def FindFileByName(self, name: str) -> FileDescriptorProto: ... - def FindFileContainingSymbol(self, symbol: str) -> FileDescriptorProto: ... - def FindAllExtensionNumbers(self, extendee_name: str) -> list[int]: ... - def FindFileContainingExtension(self, extendee_name: str, extension_number: int) -> FileDescriptorProto: ... diff --git a/stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi b/stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi deleted file mode 100644 index 31b983b4f82c..000000000000 --- a/stubs/grpcio/grpc_reflection/v1alpha/reflection_pb2_grpc.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from binascii import Incomplete -from typing import Final - -import grpc - -GRPC_GENERATED_VERSION: Final[str] -GRPC_VERSION: Final[str] - -class ServerReflectionStub: - ServerReflectionInfo: Incomplete - def __init__(self, channel: grpc.Channel) -> None: ... - -class ServerReflectionServicer: - def ServerReflectionInfo(self, request_iterator, context): ... - -def add_ServerReflectionServicer_to_server(servicer, server): ... - -class ServerReflection: - @staticmethod - def ServerReflectionInfo( - request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): ... diff --git a/stubs/grpcio/grpc_status/_async.pyi b/stubs/grpcio/grpc_status/_async.pyi deleted file mode 100644 index a636b3f59f20..000000000000 --- a/stubs/grpcio/grpc_status/_async.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from _typeshed import Incomplete - -async def from_call(call) -> Incomplete | None: ... - -__all__ = ["from_call"]