diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9b4c8f444..28d1673652 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ ci: default_stages: [pre-commit, pre-push] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.9.1 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/pyproject.toml b/pyproject.toml index a88e43c51d..ebe99118d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -326,8 +326,6 @@ ignore = [ "Q003", "COM812", "COM819", - "ISC001", - "ISC002", ] [tool.ruff.lint.extend-per-file-ignores] diff --git a/src/zarr/codecs/sharding.py b/src/zarr/codecs/sharding.py index 160a74e892..e8730c86dd 100644 --- a/src/zarr/codecs/sharding.py +++ b/src/zarr/codecs/sharding.py @@ -86,9 +86,9 @@ async def get( self, prototype: BufferPrototype, byte_range: ByteRequest | None = None ) -> Buffer | None: assert byte_range is None, "byte_range is not supported within shards" - assert ( - prototype == default_buffer_prototype() - ), f"prototype is not supported within shards currently. diff: {prototype} != {default_buffer_prototype()}" + assert prototype == default_buffer_prototype(), ( + f"prototype is not supported within shards currently. diff: {prototype} != {default_buffer_prototype()}" + ) return self.shard_dict.get(self.chunk_coords) diff --git a/src/zarr/core/indexing.py b/src/zarr/core/indexing.py index ca227be094..f1226821ba 100644 --- a/src/zarr/core/indexing.py +++ b/src/zarr/core/indexing.py @@ -289,9 +289,9 @@ def is_pure_orthogonal_indexing(selection: Selection, ndim: int) -> TypeGuard[Or def get_chunk_shape(chunk_grid: ChunkGrid) -> ChunkCoords: from zarr.core.chunk_grids import RegularChunkGrid - assert isinstance( - chunk_grid, RegularChunkGrid - ), "Only regular chunk grid is supported, currently." + assert isinstance(chunk_grid, RegularChunkGrid), ( + "Only regular chunk grid is supported, currently." + ) return chunk_grid.chunk_shape diff --git a/src/zarr/core/metadata/v3.py b/src/zarr/core/metadata/v3.py index ab62508c80..087dbd8bfc 100644 --- a/src/zarr/core/metadata/v3.py +++ b/src/zarr/core/metadata/v3.py @@ -373,9 +373,9 @@ def inner_codecs(self) -> tuple[Codec, ...]: def get_chunk_spec( self, _chunk_coords: ChunkCoords, array_config: ArrayConfig, prototype: BufferPrototype ) -> ArraySpec: - assert isinstance( - self.chunk_grid, RegularChunkGrid - ), "Currently, only regular chunk grid is supported" + assert isinstance(self.chunk_grid, RegularChunkGrid), ( + "Currently, only regular chunk grid is supported" + ) return ArraySpec( shape=self.chunk_grid.chunk_shape, dtype=self.dtype, diff --git a/tests/test_properties.py b/tests/test_properties.py index 678dcae89c..2e60c951dd 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -4,11 +4,11 @@ pytest.importorskip("hypothesis") -import hypothesis.extra.numpy as npst # noqa: E402 -import hypothesis.strategies as st # noqa: E402 -from hypothesis import given # noqa: E402 +import hypothesis.extra.numpy as npst +import hypothesis.strategies as st +from hypothesis import given -from zarr.testing.strategies import arrays, basic_indices, numpy_arrays, zarr_formats # noqa: E402 +from zarr.testing.strategies import arrays, basic_indices, numpy_arrays, zarr_formats @given(data=st.data(), zarr_format=zarr_formats)