Skip to content

Commit 4695318

Browse files
Multiple imports for an import name
1 parent ea4d7e9 commit 4695318

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

tests/package_with_entrypoint/__init__.py

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

3-
from typing import TYPE_CHECKING, Any, Literal, Self
3+
from typing import TYPE_CHECKING
44

55
import numpy as np
66
import numpy.typing as npt
@@ -14,7 +14,7 @@
1414

1515
if TYPE_CHECKING:
1616
from collections.abc import Iterable
17-
from typing import ClassVar, Literal
17+
from typing import Any, ClassVar, Literal, Self
1818

1919
from zarr.core.array_spec import ArraySpec
2020
from zarr.core.common import ZarrFormat

tests/test_api.py

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

33
import inspect
4-
import pathlib
54
import re
65
from typing import TYPE_CHECKING
76

@@ -46,10 +45,6 @@
4645
from zarr.storage._utils import normalize_path
4746
from zarr.testing.utils import gpu_test
4847

49-
if TYPE_CHECKING:
50-
from collections.abc import Callable
51-
from pathlib import Path
52-
5348

5449
def test_create(memory_store: Store) -> None:
5550
store = memory_store
@@ -1317,15 +1312,19 @@ def test_v2_with_v3_compressor() -> None:
13171312
)
13181313

13191314

1320-
def add_empty_file(path: Path) -> Path:
1315+
def add_empty_file(path: pathlib.Path) -> pathlib.Path:
13211316
fpath = path / "a.txt"
13221317
fpath.touch()
13231318
return fpath
13241319

13251320

13261321
@pytest.mark.parametrize("create_function", [create_array, from_array])
13271322
@pytest.mark.parametrize("overwrite", [True, False])
1328-
def test_no_overwrite_array(tmp_path: Path, create_function: Callable, overwrite: bool) -> None: # type:ignore[type-arg]
1323+
def test_no_overwrite_array(
1324+
tmp_path: pathlib.Path,
1325+
create_function: Callable, # type:ignore[type-arg]
1326+
overwrite: bool,
1327+
) -> None:
13291328
store = zarr.storage.LocalStore(tmp_path)
13301329
existing_fpath = add_empty_file(tmp_path)
13311330

@@ -1339,7 +1338,11 @@ def test_no_overwrite_array(tmp_path: Path, create_function: Callable, overwrite
13391338

13401339
@pytest.mark.parametrize("create_function", [create_group, group])
13411340
@pytest.mark.parametrize("overwrite", [True, False])
1342-
def test_no_overwrite_group(tmp_path: Path, create_function: Callable, overwrite: bool) -> None: # type:ignore[type-arg]
1341+
def test_no_overwrite_group(
1342+
tmp_path: pathlib.Path,
1343+
create_function: Callable, # type:ignore[type-arg]
1344+
overwrite: bool,
1345+
) -> None:
13431346
store = zarr.storage.LocalStore(tmp_path)
13441347
existing_fpath = add_empty_file(tmp_path)
13451348

@@ -1353,7 +1356,7 @@ def test_no_overwrite_group(tmp_path: Path, create_function: Callable, overwrite
13531356

13541357
@pytest.mark.parametrize("open_func", [zarr.open, open_group])
13551358
@pytest.mark.parametrize("mode", ["r", "r+", "a", "w", "w-"])
1356-
def test_no_overwrite_open(tmp_path: Path, open_func: Callable, mode: str) -> None: # type:ignore[type-arg]
1359+
def test_no_overwrite_open(tmp_path: pathlib.Path, open_func: Callable, mode: str) -> None: # type:ignore[type-arg]
13571360
store = zarr.storage.LocalStore(tmp_path)
13581361
existing_fpath = add_empty_file(tmp_path)
13591362

@@ -1366,7 +1369,7 @@ def test_no_overwrite_open(tmp_path: Path, open_func: Callable, mode: str) -> No
13661369
assert existing_fpath.exists()
13671370

13681371

1369-
def test_no_overwrite_load(tmp_path: Path) -> None:
1372+
def test_no_overwrite_load(tmp_path: pathlib.Path) -> None:
13701373
store = zarr.storage.LocalStore(tmp_path)
13711374
existing_fpath = add_empty_file(tmp_path)
13721375

0 commit comments

Comments
 (0)