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

ci(pre-commit.ci): autoupdate #344

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ exclude: .asv

repos:
- repo: https://github.com/crate-ci/typos
rev: typos-dict-v0.11.35
rev: typos-dict-v0.11.37
hooks:
- id: typos

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.8.1
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
- id: ruff-format

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.22
rev: v0.23
hooks:
- id: validate-pyproject

Expand Down
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
Loading