Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
fix(saq): Upgrade to typed release.
Browse files Browse the repository at this point in the history
Upgraded to 0.9.1 which includes types.

Removes type:ignore comments.

Closes #91
  • Loading branch information
peterschutt committed Nov 14, 2022
1 parent 2bbe509 commit 7ac37c3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
23 changes: 12 additions & 11 deletions poetry.lock

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

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ orjson = "*"
pydantic = "*"
python-dotenv = "*"
redis = "*"
saq = "*"
saq = "^0.9.1"
sentry-sdk = "*"
sqlalchemy = "==2.0.0b3"
starlite = "~=1.39"
starlite = "^1.39"
structlog = "*"
uvicorn = "*"
uvloop = "*"
Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/init_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def example_handler() -> dict:
from collections.abc import Callable, Sequence
from typing import Any

from saq.worker import Worker # type:ignore[import]
from saq.worker import Worker
from starlite.config.app import AppConfig
from structlog.types import Processor

Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/log/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if TYPE_CHECKING:
from typing import Any, TypeAlias

from saq import Job # type:ignore[import]
from saq import Job

LOGGER = structlog.get_logger()

Expand Down
12 changes: 6 additions & 6 deletions src/starlite_saqlalchemy/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from typing import TYPE_CHECKING, Any

import orjson
import saq # type:ignore[import]
import saq

from starlite_saqlalchemy import redis

if TYPE_CHECKING:
from collections.abc import Callable, Collection
from collections.abc import Awaitable, Callable, Collection
from signal import Signals

__all__ = [
Expand All @@ -22,7 +22,7 @@
]


class Queue(saq.Queue): # type:ignore[misc]
class Queue(saq.Queue):
"""[SAQ Queue](https://github.com/tobymao/saq/blob/master/saq/queue.py).
Configures `orjson` for JSON serialization/deserialization if not otherwise configured.
Expand All @@ -38,7 +38,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)


class Worker(saq.Worker): # type:ignore[misc]
class Worker(saq.Worker):
"""Modify behavior of saq worker for orchestration by Starlite."""

# same issue: https://github.com/samuelcolvin/arq/issues/182
Expand All @@ -59,8 +59,8 @@ async def on_app_startup(self) -> None: # pragma: no cover

def create_worker_instance(
functions: Collection[Callable[..., Any] | tuple[str, Callable]],
before_process: Callable[[dict[str, Any]], None] | None = None,
after_process: Callable[[dict[str, Any]], None] | None = None,
before_process: Callable[[dict[str, Any]], Awaitable[Any]] | None = None,
after_process: Callable[[dict[str, Any]], Awaitable[Any]] | None = None,
) -> Worker:
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from unittest.mock import MagicMock

import pytest
from saq.job import Job # type:ignore[import]
from saq.job import Job
from starlite.datastructures import State
from starlite.enums import ScopeType
from starlite.testing import TestClient
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from typing import Any

from pytest import MonkeyPatch
from saq.job import Job # type:ignore[import]
from saq.job import Job
from starlite import Starlite, State
from starlite.types.asgi_types import (
HTTPResponseBodyEvent,
Expand Down

0 comments on commit 7ac37c3

Please sign in to comment.