diff --git a/changelog.d/385.bugfix b/changelog.d/385.bugfix new file mode 100644 index 00000000..45c4bb69 --- /dev/null +++ b/changelog.d/385.bugfix @@ -0,0 +1 @@ +Change package name back to matrix-sygnal. diff --git a/pyproject.toml b/pyproject.toml index 694a7278..dd0b1fb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,12 +55,15 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry] -name = "sygnal" +name = "matrix-sygnal" version = "0.14.4" description = "Reference Push Gateway for Matrix Notifications" authors = ["Matrix.org Team and Contributors "] readme = "README.md" license = "Apache-2.0" +packages = [ + { include = "sygnal" }, +] include = [ { path = "tests", format = "sdist" }, ] diff --git a/sygnal/http.py b/sygnal/http.py index 9669b71d..bc348926 100644 --- a/sygnal/http.py +++ b/sygnal/http.py @@ -19,7 +19,7 @@ import sys import time import traceback -from typing import TYPE_CHECKING, Callable, List, Union +from typing import TYPE_CHECKING, Any, Callable, List, Union from uuid import uuid4 from opentracing import Format, Span, logs, tags @@ -177,7 +177,7 @@ def _handle_request(self, request: Request) -> Union[int, bytes]: root_span_accounted_for = True - async def cb(): + async def cb() -> None: with REQUESTS_IN_FLIGHT_GUAGE.labels( self.__class__.__name__ ).track_inprogress(): @@ -342,7 +342,10 @@ class SygnalLoggedSite(server.Site): """ def __init__( - self, *args, log_formatter: Callable[[str, server.Request], str], **kwargs + self, + *args: Any, + log_formatter: Callable[[str, server.Request], str], + **kwargs: Any, ): super().__init__(*args, **kwargs) self.log_formatter = log_formatter diff --git a/sygnal/notifications.py b/sygnal/notifications.py index ec734174..10ab44ca 100644 --- a/sygnal/notifications.py +++ b/sygnal/notifications.py @@ -83,7 +83,7 @@ def __init__(self, raw: Dict[str, Any]): class Notification: - def __init__(self, notif): + def __init__(self, notif: dict): # optional attributes self.room_name: Optional[str] = notif.get("room_name") self.room_alias: Optional[str] = notif.get("room_alias") diff --git a/sygnal/sygnal.py b/sygnal/sygnal.py index ce3ca5cf..2921e1f6 100644 --- a/sygnal/sygnal.py +++ b/sygnal/sygnal.py @@ -20,7 +20,7 @@ import logging.config import os import sys -from typing import Any, Dict, Set, cast +from typing import Any, Dict, Generator, Set, cast import opentracing import prometheus_client @@ -28,7 +28,7 @@ from opentracing import Tracer from opentracing.scope_managers.asyncio import AsyncioScopeManager from twisted.internet import asyncioreactor, defer -from twisted.internet.defer import ensureDeferred +from twisted.internet.defer import Deferred, ensureDeferred from twisted.internet.interfaces import ( IReactorCore, IReactorFDSet, @@ -223,7 +223,7 @@ def run(self) -> None: """ @defer.inlineCallbacks - def start(): + def start() -> Generator[Deferred[Any], Any, Any]: try: yield ensureDeferred(self.make_pushkins_then_start()) except Exception: @@ -337,7 +337,7 @@ def merge_left_with_defaults( return result -def main(): +def main() -> None: # TODO we don't want to have to install the reactor, when we can get away with # it asyncioreactor.install()