From bb7e5aaa0458d2b843b61ad6a8f22eccfad64e3e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 20:15:26 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/codespell-project/codespell: v2.4.1 → v2.4.3](https://github.com/codespell-project/codespell/compare/v2.4.1...v2.4.3) - [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.16.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.8...v0.16.0) - [github.com/executablebooks/mdformat: 0.7.22 → 1.0.0](https://github.com/executablebooks/mdformat/compare/0.7.22...1.0.0) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e863bf7..6e42aa4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -20,18 +20,18 @@ repos: - id: sort-simple-yaml - id: trailing-whitespace - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 + rev: v2.4.3 hooks: - id: codespell additional_dependencies: ["tomli"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.8 + rev: v0.16.0 hooks: - id: ruff args: [ --fix ] - id: ruff-format - repo: https://github.com/executablebooks/mdformat - rev: 0.7.22 + rev: 1.0.0 hooks: - id: mdformat args: ["--wrap=80"] From 30baa28e1d77454d10ef24c15da285d3e0315d15 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 20:16:03 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- znfields/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/znfields/__init__.py b/znfields/__init__.py index 85a7b0d..90a0d45 100644 --- a/znfields/__init__.py +++ b/znfields/__init__.py @@ -1,19 +1,16 @@ import dataclasses import functools -from typing import Any, Callable, Optional +from collections.abc import Callable +from typing import Any, Optional class _ZNFIELDS_GETTER_TYPE: """Sentinel class to identify the getter type.""" - pass - class _ZNFIELDS_SETTER_TYPE: """Sentinel class used to identify the setter type.""" - pass - # Sentinels to identify the getter and setter types ZNFIELDS_GETTER_TYPE = _ZNFIELDS_GETTER_TYPE() @@ -85,8 +82,8 @@ def __setattr__(self, name: str, value: Any) -> None: @functools.wraps(dataclasses.field) def field( *, - getter: Optional[Callable[[Any, str], Any]] = None, - setter: Optional[Callable[[Any, str, Any], None]] = None, + getter: Callable[[Any, str], Any] | None = None, + setter: Callable[[Any, str, Any], None] | None = None, **kwargs, ) -> dataclasses.Field: """Wrapper around `dataclasses.field` to allow for defining custom