Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Bump twisted from 22.10.0 to 23.8.0 #16235

Merged
merged 5 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/16235.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix type checking when using the new version of Twisted.
37 changes: 18 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions synapse/handlers/initial_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import logging
from typing import TYPE_CHECKING, List, Optional, Tuple, cast
from typing import TYPE_CHECKING, List, Optional, Tuple

from synapse.api.constants import (
AccountDataTypes,
Expand All @@ -23,7 +23,6 @@
Membership,
)
from synapse.api.errors import SynapseError
from synapse.events import EventBase
from synapse.events.utils import SerializeEventConfig
from synapse.events.validator import EventValidator
from synapse.handlers.presence import format_user_presence_state
Expand All @@ -35,7 +34,6 @@
JsonDict,
Requester,
RoomStreamToken,
StateMap,
StreamKeyType,
StreamToken,
UserID,
Expand Down Expand Up @@ -199,9 +197,7 @@ async def handle_room(event: RoomsForUser) -> None:
deferred_room_state = run_in_background(
self._state_storage_controller.get_state_for_events,
[event.event_id],
).addCallback(
lambda states: cast(StateMap[EventBase], states[event.event_id])
)
).addCallback(lambda states: states[event.event_id])

(messages, token), current_state = await make_deferred_yieldable(
gather_results(
Expand Down
4 changes: 2 additions & 2 deletions synapse/logging/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ async def _unwrap_awaitable(awaitable: Awaitable[R]) -> R:


@overload
def preserve_fn( # type: ignore[misc]
def preserve_fn(
f: Callable[P, Awaitable[R]],
) -> Callable[P, "defer.Deferred[R]"]:
# The `type: ignore[misc]` above suppresses
Expand Down Expand Up @@ -756,7 +756,7 @@ def g(*args: P.args, **kwargs: P.kwargs) -> "defer.Deferred[R]":


@overload
def run_in_background( # type: ignore[misc]
def run_in_background(
f: Callable[P, Awaitable[R]], *args: P.args, **kwargs: P.kwargs
) -> "defer.Deferred[R]":
# The `type: ignore[misc]` above suppresses
Expand Down
2 changes: 1 addition & 1 deletion synapse/util/gai_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(

# The types on IHostnameResolver is incorrect in Twisted, see
# https://twistedmatrix.com/trac/ticket/10276
def resolveHostName( # type: ignore[override]
def resolveHostName(
self,
resolutionReceiver: IResolutionReceiver,
hostName: str,
Expand Down
Loading