Skip to content

Commit 52cddd9

Browse files
Bump mypy from 1.10.1 to 1.11.2 (#2031)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: beagold <86345081+beagold@users.noreply.github.com>
1 parent f132011 commit 52cddd9

File tree

5 files changed

+8
-111
lines changed

5 files changed

+8
-111
lines changed

dev-requirements/mypy.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mypy==1.10.1
1+
mypy==1.11.2

hikari/api/interaction_server.py

-32
Original file line numberDiff line numberDiff line change
@@ -133,38 +133,6 @@ async def on_interaction(self, body: bytes, signature: bytes, timestamp: bytes)
133133
the interaction request.
134134
"""
135135

136-
@typing.overload
137-
@abc.abstractmethod
138-
def get_listener(
139-
self, interaction_type: type[command_interactions.CommandInteraction], /
140-
) -> typing.Optional[ListenerT[command_interactions.CommandInteraction, _ModalOrMessageResponseBuilder]]: ...
141-
142-
@typing.overload
143-
@abc.abstractmethod
144-
def get_listener(
145-
self, interaction_type: type[component_interactions.ComponentInteraction], /
146-
) -> typing.Optional[ListenerT[component_interactions.ComponentInteraction, _ModalOrMessageResponseBuilder]]: ...
147-
148-
@typing.overload
149-
@abc.abstractmethod
150-
def get_listener(
151-
self, interaction_type: type[command_interactions.AutocompleteInteraction], /
152-
) -> typing.Optional[
153-
ListenerT[command_interactions.AutocompleteInteraction, special_endpoints.InteractionAutocompleteBuilder]
154-
]: ...
155-
156-
@typing.overload
157-
@abc.abstractmethod
158-
def get_listener(
159-
self, interaction_type: type[modal_interactions.ModalInteraction], /
160-
) -> typing.Optional[ListenerT[modal_interactions.ModalInteraction, _MessageResponseBuilderT]]: ...
161-
162-
@typing.overload
163-
@abc.abstractmethod
164-
def get_listener(
165-
self, interaction_type: type[_InteractionT_co], /
166-
) -> typing.Optional[ListenerT[_InteractionT_co, special_endpoints.InteractionResponseBuilder]]: ...
167-
168136
@abc.abstractmethod
169137
def get_listener(
170138
self, interaction_type: type[_InteractionT_co], /

hikari/impl/interaction_server.py

-37
Original file line numberDiff line numberDiff line change
@@ -598,43 +598,6 @@ async def start(
598598
_LOGGER.info("Starting site on %s", site.name)
599599
await site.start()
600600

601-
@typing.overload
602-
def get_listener(
603-
self, interaction_type: type[command_interactions.CommandInteraction], /
604-
) -> typing.Optional[
605-
interaction_server.ListenerT[command_interactions.CommandInteraction, _ModalOrMessageResponseBuilderT]
606-
]: ...
607-
608-
@typing.overload
609-
def get_listener(
610-
self, interaction_type: type[component_interactions.ComponentInteraction], /
611-
) -> typing.Optional[
612-
interaction_server.ListenerT[component_interactions.ComponentInteraction, _ModalOrMessageResponseBuilderT]
613-
]: ...
614-
615-
@typing.overload
616-
def get_listener(
617-
self, interaction_type: type[command_interactions.AutocompleteInteraction], /
618-
) -> typing.Optional[
619-
interaction_server.ListenerT[
620-
command_interactions.AutocompleteInteraction, special_endpoints.InteractionAutocompleteBuilder
621-
]
622-
]: ...
623-
624-
@typing.overload
625-
def get_listener(
626-
self, interaction_type: type[modal_interactions.ModalInteraction], /
627-
) -> typing.Optional[
628-
interaction_server.ListenerT[modal_interactions.ModalInteraction, _MessageResponseBuilderT]
629-
]: ...
630-
631-
@typing.overload
632-
def get_listener(
633-
self, interaction_type: type[_InteractionT_co], /
634-
) -> typing.Optional[
635-
interaction_server.ListenerT[_InteractionT_co, special_endpoints.InteractionResponseBuilder]
636-
]: ...
637-
638601
def get_listener(
639602
self, interaction_type: type[_InteractionT_co], /
640603
) -> typing.Optional[interaction_server.ListenerT[_InteractionT_co, special_endpoints.InteractionResponseBuilder]]:

hikari/impl/rest_bot.py

-37
Original file line numberDiff line numberDiff line change
@@ -683,43 +683,6 @@ async def start(
683683
ssl_context=ssl_context,
684684
)
685685

686-
@typing.overload
687-
def get_listener(
688-
self, interaction_type: type[command_interactions.CommandInteraction], /
689-
) -> typing.Optional[
690-
interaction_server_.ListenerT[command_interactions.CommandInteraction, _ModalOrMessageResponseBuilderT]
691-
]: ...
692-
693-
@typing.overload
694-
def get_listener(
695-
self, interaction_type: type[component_interactions.ComponentInteraction], /
696-
) -> typing.Optional[
697-
interaction_server_.ListenerT[component_interactions.ComponentInteraction, _ModalOrMessageResponseBuilderT]
698-
]: ...
699-
700-
@typing.overload
701-
def get_listener(
702-
self, interaction_type: type[command_interactions.AutocompleteInteraction], /
703-
) -> typing.Optional[
704-
interaction_server_.ListenerT[
705-
command_interactions.AutocompleteInteraction, special_endpoints.InteractionAutocompleteBuilder
706-
]
707-
]: ...
708-
709-
@typing.overload
710-
def get_listener(
711-
self, interaction_type: type[modal_interactions.ModalInteraction], /
712-
) -> typing.Optional[
713-
interaction_server_.ListenerT[modal_interactions.ModalInteraction, _MessageResponseBuilderT]
714-
]: ...
715-
716-
@typing.overload
717-
def get_listener(
718-
self, interaction_type: type[_InteractionT_co], /
719-
) -> typing.Optional[
720-
interaction_server_.ListenerT[_InteractionT_co, special_endpoints.InteractionResponseBuilder]
721-
]: ...
722-
723686
def get_listener(
724687
self, interaction_type: type[_InteractionT_co], /
725688
) -> typing.Optional[interaction_server_.ListenerT[_InteractionT_co, special_endpoints.InteractionResponseBuilder]]:

hikari/impl/special_endpoints.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ async def __call__(
104104
auth: undefined.UndefinedNoneOr[str] = undefined.UNDEFINED,
105105
) -> typing.Union[None, data_binding.JSONObject, data_binding.JSONArray]: ...
106106

107-
class _ThreadDeserializeSig(typing.Protocol["_GuildThreadChannelCovT"]):
107+
_GuildThreadChannelCovT = typing.TypeVar(
108+
"_GuildThreadChannelCovT", bound=channels.GuildThreadChannel, covariant=True
109+
)
110+
111+
class _ThreadDeserializeSig(typing.Protocol[_GuildThreadChannelCovT]):
108112
def __call__(
109113
self,
110114
payload: data_binding.JSONObject,
@@ -118,7 +122,6 @@ def __call__(
118122

119123
_ParentT = typing.TypeVar("_ParentT")
120124
_GuildThreadChannelT = typing.TypeVar("_GuildThreadChannelT", bound=channels.GuildThreadChannel)
121-
_GuildThreadChannelCovT = typing.TypeVar("_GuildThreadChannelCovT", bound=channels.GuildThreadChannel, covariant=True)
122125

123126

124127
@typing.final
@@ -830,7 +833,7 @@ class GuildThreadIterator(iterators.BufferedLazyIterator[_GuildThreadChannelT]):
830833

831834
def __init__(
832835
self,
833-
deserialize: _ThreadDeserializeSig[_GuildThreadChannelCovT],
836+
deserialize: _ThreadDeserializeSig[_GuildThreadChannelT],
834837
entity_factory: entity_factory_.EntityFactory,
835838
request_call: _RequestCallSig,
836839
route: routes.CompiledRoute,
@@ -846,7 +849,7 @@ def __init__(
846849
self._request_call = request_call
847850
self._route = route
848851

849-
async def _next_chunk(self) -> typing.Optional[typing.Generator[_GuildThreadChannelCovT, typing.Any, None]]:
852+
async def _next_chunk(self) -> typing.Optional[typing.Generator[_GuildThreadChannelT, typing.Any, None]]:
850853
if not self._has_more:
851854
return None
852855

0 commit comments

Comments
 (0)