Skip to content

Commit 5c136b1

Browse files
[pre-commit.ci] pre-commit autoupdate (#2817)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.11.4](astral-sh/ruff-pre-commit@v0.9.9...v0.11.4) - [github.com/python-jsonschema/check-jsonschema: 0.31.2 → 0.32.1](python-jsonschema/check-jsonschema@0.31.2...0.32.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent df1daf0 commit 5c136b1

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ ci:
22
autoupdate_schedule: monthly
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.9.9
5+
rev: v0.11.4
66
hooks:
77
- id: ruff
88
- id: ruff-format
99
- repo: https://github.com/python-jsonschema/check-jsonschema
10-
rev: 0.31.2
10+
rev: 0.32.1
1111
hooks:
1212
- id: check-github-workflows
1313
- id: check-readthedocs

src/marshmallow/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def set_hook(
241241

242242
# Set a __marshmallow_hook__ attribute instead of wrapping in some class,
243243
# because I still want this to end up as a normal (unbound) method.
244-
function = cast(MarshmallowHook, fn)
244+
function = cast("MarshmallowHook", fn)
245245
try:
246246
hook_config = function.__marshmallow_hook__
247247
except AttributeError:

src/marshmallow/experimental/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __enter__(self) -> Context[_ContextT]:
5959
return self
6060

6161
def __exit__(self, *args, **kwargs) -> None:
62-
_CURRENT_CONTEXT.reset(typing.cast(contextvars.Token, self.token))
62+
_CURRENT_CONTEXT.reset(typing.cast("contextvars.Token", self.token))
6363

6464
@classmethod
6565
def get(cls, default: _DefaultT | EllipsisType = ...) -> _ContextT | _DefaultT:

src/marshmallow/fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def schema(self) -> Schema:
538538
if isinstance(nested, Schema):
539539
self._schema = copy.copy(nested)
540540
# Respect only and exclude passed from parent and re-initialize fields
541-
set_class = typing.cast(type[set], self._schema.set_class)
541+
set_class = typing.cast("type[set]", self._schema.set_class)
542542
if self.only is not None:
543543
if self._schema.only is not None:
544544
original = self._schema.only
@@ -742,7 +742,7 @@ def _deserialize(self, value, attr, data, **kwargs) -> list[_InternalT | None]:
742742
result.append(self.inner.deserialize(each, **kwargs))
743743
except ValidationError as error:
744744
if error.valid_data is not None:
745-
result.append(typing.cast(_InternalT, error.valid_data))
745+
result.append(typing.cast("_InternalT", error.valid_data))
746746
errors.update({idx: error.messages})
747747
if errors:
748748
raise ValidationError(errors, valid_data=result)

src/marshmallow/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class SchemaMeta(ABCMeta):
9898
_declared_fields: dict[str, Field]
9999

100100
def __new__(
101-
mcs, # noqa: N804
101+
mcs,
102102
name: str,
103103
bases: tuple[type, ...],
104104
attrs: dict[str, typing.Any],
@@ -830,7 +830,7 @@ def validate(
830830
try:
831831
self._do_load(data, many=many, partial=partial, postprocess=False)
832832
except ValidationError as exc:
833-
return typing.cast(dict[str, list[str]], exc.messages)
833+
return typing.cast("dict[str, list[str]]", exc.messages)
834834
return {}
835835

836836
##### Private Helpers #####

0 commit comments

Comments
 (0)