Skip to content

Commit

Permalink
Change package name back to matrix-sygnal (#385)
Browse files Browse the repository at this point in the history
* Change package name back to matrix-sygnal

* Add changelog entry

* Rename package fully to matrix-sygnal

* Fix usage to keep existing internal package name

* Undo Self annotation since it breaks 3.8 linting
  • Loading branch information
devonh authored Jun 26, 2024
1 parent cf37677 commit a6caf25
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions changelog.d/385.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change package name back to matrix-sygnal.
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
readme = "README.md"
license = "Apache-2.0"
packages = [
{ include = "sygnal" },
]
include = [
{ path = "tests", format = "sdist" },
]
Expand Down
9 changes: 6 additions & 3 deletions sygnal/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sygnal/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions sygnal/sygnal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
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
import yaml
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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a6caf25

Please sign in to comment.