Skip to content

Commit

Permalink
ci: ⚙️ Ensure compatibility with current mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
ddanier committed Mar 8, 2023
1 parent fbfc5ff commit 4e67643
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions async_signals/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import threading
import weakref
from typing import Any, Callable, Dict, Hashable, List, Tuple, Type, Union
from typing import Any, Callable, Dict, Hashable, List, Optional, Tuple, Type, Union

from .utils import func_accepts_kwargs

Expand Down Expand Up @@ -133,9 +133,9 @@ def connect(

def disconnect(
self,
receiver: Callable = None,
sender: Hashable = None,
dispatch_uid: Hashable = None,
receiver: Optional[Callable] = None,
sender: Optional[Hashable] = None,
dispatch_uid: Optional[Hashable] = None,
) -> bool:
"""
Disconnect receiver from sender for signal.
Expand Down Expand Up @@ -342,7 +342,7 @@ def _live_receivers(self, sender: Union[Hashable, None]) -> List[Callable]:
non_weak_receivers.append(receiver)
return non_weak_receivers

def _remove_receiver(self, receiver: Callable = None) -> None:
def _remove_receiver(self, receiver: Optional[Callable] = None) -> None:
# Mark that the self.receivers list has dead weakrefs. If so, we will
# clean those up in connect, disconnect and _live_receivers while
# holding self.lock. Note that doing the cleanup here isn't a good
Expand All @@ -355,9 +355,9 @@ def _remove_receiver(self, receiver: Callable = None) -> None:
def receiver(
signal: Union[Signal, List[Signal], Tuple[Signal, ...]],
*,
sender: Hashable = None,
sender: Optional[Hashable] = None,
weak: bool = True,
dispatch_uid: Hashable = None,
dispatch_uid: Optional[Hashable] = None,
) -> Callable:
"""
A decorator for connecting receivers to signals. Used by passing in the
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python = "^3.8"
[tool.poetry.group.dev.dependencies]
pytest = "^7.1.3"
isort = "^5.10.1"
mypy = "^0.971"
mypy = ">=0.971,<1.1"
flake8 = "^5.0.4"
flake8-builtins = ">=1.5.3,<3.0.0"
flake8-annotations = "^2.9.1"
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ isolated_build = True
envlist =
py38,
py39,
py310
py310,
py311

[testenv]
deps =
Expand Down

0 comments on commit 4e67643

Please sign in to comment.