Skip to content

Commit

Permalink
ci(pre-commit.ci): autoupdate (#219)
Browse files Browse the repository at this point in the history
* ci(pre-commit.ci): autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.277 → v0.0.281](astral-sh/ruff-pre-commit@v0.0.277...v0.0.281)
- [github.com/psf/black: 23.3.0 → 23.7.0](psf/black@23.3.0...23.7.0)

* style(pre-commit.ci): auto fixes [...]

* bump

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Talley Lambert <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and tlambert03 authored Aug 11, 2023
1 parent e884014 commit 89e728b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
rev: v0.0.282
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black

Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_evented_model_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __new__(

cls.__eq_operators__ = {}
signals = {}
fields: Dict[str, "ModelField"] = cls.__fields__
fields: Dict[str, ModelField] = cls.__fields__
for n, f in fields.items():
cls.__eq_operators__[n] = _pick_equality_operator(f.type_)
if f.field_info.allow_mutation:
Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/containers/_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _update_active(self) -> None:
An active item is a single selected item.
"""
if len(self) == 1:
self.active = list(self)[0]
self.active = next(iter(self))
elif self._active is not None:
self._active = None
self.events.active.emit(None)
Expand Down
4 changes: 2 additions & 2 deletions tests/containers/test_evented_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ def test_numpy_proxy():
mock = Mock()
with monitor_events(t.events, mock):
t[0] = 2
signal, (key, value) = tuple(mock.call_args)[0][0]
signal, (key, value) = next(iter(mock.call_args))[0]
assert signal.name == "item_set"
assert key == 0
assert np.array_equal(value, [2, 2, 2, 2])
mock.reset_mock()

t[2:] = np.arange(8).reshape(2, 4)

signal, (key, value) = tuple(mock.call_args)[0][0]
signal, (key, value) = next(iter(mock.call_args))[0]
assert signal.name == "item_set"
assert key == slice(2, None, None)
assert np.array_equal(value, [[0, 1, 2, 3], [4, 5, 6, 7]])
Expand Down

0 comments on commit 89e728b

Please sign in to comment.