Skip to content

Commit da1bc73

Browse files
Apply ruff/flake8-type-checking rule TCH003
TCH003 Move standard library import into a type-checking block
1 parent 274ca82 commit da1bc73

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/zarr/abc/codec.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from abc import abstractmethod
4-
from collections.abc import Awaitable, Callable, Iterable
54
from typing import TYPE_CHECKING, Any, Generic, TypeVar
65

76
from zarr.abc.metadata import Metadata
@@ -10,6 +9,8 @@
109
from zarr.core.config import config
1110

1211
if TYPE_CHECKING:
12+
from collections.abc import Awaitable, Callable, Iterable
13+
1314
import numpy as np
1415
from typing_extensions import Self
1516

src/zarr/api/asynchronous.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import asyncio
44
import warnings
5-
from collections.abc import Iterable
65
from typing import TYPE_CHECKING, Any, Literal, Union, cast
76

87
import numpy as np
@@ -18,6 +17,8 @@
1817
)
1918

2019
if TYPE_CHECKING:
20+
from collections.abc import Iterable
21+
2122
from zarr.abc.codec import Codec
2223
from zarr.core.buffer import NDArrayLike
2324
from zarr.core.chunk_key_encodings import ChunkKeyEncoding

tests/v3/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from __future__ import annotations
22

33
import pathlib
4-
from collections.abc import Iterator
54
from dataclasses import dataclass, field
6-
from types import ModuleType
75
from typing import TYPE_CHECKING
86

97
import numpy as np
@@ -15,6 +13,8 @@
1513
from zarr.store.remote import RemoteStore
1614

1715
if TYPE_CHECKING:
16+
from collections.abc import Iterator
17+
from types import ModuleType
1818
from typing import Any, Literal
1919

2020
from zarr.abc.store import Store

tests/v3/test_indexing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@
2222
from zarr.store.common import StorePath
2323
from zarr.store.memory import MemoryStore
2424

25-
if TYPE_CHECKING:
26-
from zarr.abc.store import Store
27-
2825
if TYPE_CHECKING:
2926
from collections.abc import Iterator
3027

28+
from zarr.abc.store import Store
3129
from zarr.core.common import ChunkCoords
3230

3331

0 commit comments

Comments
 (0)