Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change package name back to matrix-sygnal #385

Merged
merged 6 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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/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.3"
description = "Reference Push Gateway for Matrix Notifications"
authors = ["Matrix.org Team and Contributors <packages@matrix.org>"]
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
Loading