Skip to content

Commit

Permalink
style(pre-commit.ci): auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 3, 2024
1 parent a631d39 commit 34a21a0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions src/psygnal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from ._evented_model import EventedModel # noqa: TCH004
from ._evented_model import EventedModel # noqa: TC004


try:
Expand All @@ -19,20 +19,20 @@
__email__ = "[email protected]"

__all__ = [
"__version__",
"_compiled",
"debounced",
"EmissionInfo",
"emit_queued",
"EmitLoopError",
"evented",
"EventedModel",
"get_evented_namespace",
"is_evented",
"Signal",
"SignalGroup",
"SignalGroupDescriptor",
"SignalInstance",
"__version__",
"_compiled",
"debounced",
"emit_queued",
"evented",
"get_evented_namespace",
"is_evented",
"throttled",
]

Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_evented_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
import warnings
from collections.abc import Iterator, Mapping
from collections.abc import Iterator
from contextlib import contextmanager, suppress
from typing import (
TYPE_CHECKING,
Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def block(self, exclude: Iterable[str | SignalInstance] = ()) -> None:
"""Block this signal and all emitters from emitting."""
super().block()
for name, sig in self._signals.items():
if exclude and sig in exclude or name in exclude:
if (exclude and sig in exclude) or name in exclude:
continue
self._sig_was_blocked[name] = sig._is_blocked
sig.block()
Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_group_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
EqOperator: TypeAlias = Callable[[Any, Any], bool]
FieldAliasFunc: TypeAlias = Callable[[str], Optional[str]]

__all__ = ["is_evented", "get_evented_namespace", "SignalGroupDescriptor"]
__all__ = ["SignalGroupDescriptor", "get_evented_namespace", "is_evented"]


T = TypeVar("T", bound=type)
Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_weak_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

RefErrorChoice: TypeAlias = Literal["raise", "warn", "ignore"]

__all__ = ["weak_callback", "WeakCallback"]
__all__ = ["WeakCallback", "weak_callback"]
_T = TypeVar("_T")
_R = TypeVar("_R") # return type of cb

Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if TYPE_CHECKING:
from collections.abc import Generator, Iterator

__all__ = ["monitor_events", "iter_signal_instances"]
__all__ = ["iter_signal_instances", "monitor_events"]


def _default_event_monitor(info: EmissionInfo) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_evented_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ def d(self, value):
],
)
def test_evented_model_reemission(mode: Union[str, dict]) -> None:
err = mode == "err" or isinstance(mode, dict) and "err" in mode.values()
err = mode == "err" or (isinstance(mode, dict) and "err" in mode.values())
with (
pytest.raises(ValueError, match="Invalid reemission") if err else nullcontext()
):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_psygnal.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def test_connect_validation(func_name, sig_name, mode, typed):
signal: SignalInstance = getattr(e, sig_name)
bad_count = COUNT_INCOMPATIBLE[sig_name]
bad_sig = SIG_INCOMPATIBLE[sig_name]
if func_name in bad_count or check_types and func_name in bad_sig:
if func_name in bad_count or (check_types and func_name in bad_sig):
with pytest.raises(ValueError) as er:
signal.connect(func, check_types=check_types)
assert "Accepted signature:" in str(er)
Expand Down

0 comments on commit 34a21a0

Please sign in to comment.