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

Commit

Permalink
Bump twisted from 22.10.0 to 23.8.0 (#16235)
Browse files Browse the repository at this point in the history
* Bump twisted from 22.10.0 to 23.8.0

Bumps [twisted](https://github.com/twisted/twisted) from 22.10.0 to 23.8.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst)
- [Commits](twisted/twisted@twisted-22.10.0...twisted-23.8.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix types

* Fix lint

* Newsfile

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Erik Johnston <erik@matrix.org>
  • Loading branch information
2 people authored and clokep committed Sep 5, 2023
1 parent d77154b commit bdad0e9
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
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

0 comments on commit bdad0e9

Please sign in to comment.