Skip to content

chore: update pre-commit hooks #762

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

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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: debug-statements

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.12
rev: v0.12.2
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -26,7 +26,7 @@ repos:
- id: sp-repo-review

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.16.0
rev: v1.16.1
hooks:
- id: mypy
args: [--config-file, pyproject.toml]
Expand Down
3 changes: 1 addition & 2 deletions numcodecs/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@
"""

from abc import ABC, abstractmethod
from typing import Optional


class Codec(ABC):
"""Codec abstract base class."""

# override in sub-class
codec_id: Optional[str] = None
codec_id: str | None = None
"""Codec identifier."""

@abstractmethod
Expand Down
4 changes: 2 additions & 2 deletions numcodecs/checksum32.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import zlib
from contextlib import suppress
from types import ModuleType
from typing import Literal, Optional
from typing import Literal

import numpy as np
from typing_extensions import Buffer
Expand All @@ -12,7 +12,7 @@
from .compat import ensure_contiguous_ndarray, ndarray_copy
from .jenkins import jenkins_lookup3

_crc32c: Optional[ModuleType] = None
_crc32c: ModuleType | None = None
with suppress(ImportError):
import crc32c as _crc32c # type: ignore[no-redef, unused-ignore]

Expand Down
3 changes: 1 addition & 2 deletions numcodecs/lzma.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from types import ModuleType
from typing import Optional

_lzma: Optional[ModuleType] = None
_lzma: ModuleType | None = None
try:
import lzma as _lzma
except ImportError: # pragma: no cover
Expand Down
3 changes: 1 addition & 2 deletions numcodecs/zfpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
from contextlib import suppress
from importlib.metadata import PackageNotFoundError, version
from types import ModuleType
from typing import Optional

_zfpy: Optional[ModuleType] = None
_zfpy: ModuleType | None = None

_zfpy_version: tuple = ()
with suppress(PackageNotFoundError):
Expand Down
Loading