File tree Expand file tree Collapse file tree 6 files changed +14
-8
lines changed Expand file tree Collapse file tree 6 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 12
12
13
13
import bz2
14
14
import gzip
15
- import io
16
15
import typing as ty
17
16
18
17
from .optpkg import optional_package
19
18
20
19
if ty .TYPE_CHECKING :
20
+ import io
21
+
21
22
import indexed_gzip # type: ignore[import]
22
23
import pyzstd
23
24
Original file line number Diff line number Diff line change 10
10
11
11
from __future__ import annotations
12
12
13
- import io
14
13
import typing as ty
15
14
from copy import copy
16
15
17
16
from .openers import ImageOpener
18
17
18
+ if ty .TYPE_CHECKING :
19
+ import io
20
+
19
21
20
22
class FileHolderError (Exception ):
21
23
pass
Original file line number Diff line number Diff line change 3
3
from __future__ import annotations
4
4
5
5
import typing as ty
6
- from types import ModuleType
7
6
8
7
from packaging .version import Version
9
8
10
9
from .tripwire import TripWire
11
10
11
+ if ty .TYPE_CHECKING :
12
+ from types import ModuleType
13
+
12
14
13
15
def _check_pkg_version (min_version : str | Version ) -> ty .Callable [[ModuleType ], bool ]:
14
16
min_ver = Version (min_version ) if isinstance (min_version , str ) else min_version
Original file line number Diff line number Diff line change 132
132
133
133
from __future__ import annotations
134
134
135
- import io
136
135
import typing as ty
137
- from collections .abc import Sequence
138
136
from typing import Literal
139
137
140
138
import numpy as np
153
151
from functools import lru_cache as cache
154
152
155
153
if ty .TYPE_CHECKING :
154
+ import io
155
+ from collections .abc import Sequence
156
+
156
157
import numpy .typing as npt
157
158
158
159
from .arrayproxy import ArrayLike
Original file line number Diff line number Diff line change 27
27
from .np_features import memmap_after_ufunc
28
28
29
29
if ty .TYPE_CHECKING :
30
- from importlib_resources .abc import Traversable
30
+ from importlib . resources .abc import Traversable
31
31
32
32
try :
33
33
from importlib .resources import as_file , files
34
- from importlib .resources .abc import Traversable
35
34
except ImportError : # PY38
36
35
from importlib_resources import as_file , files
37
36
Original file line number Diff line number Diff line change 10
10
11
11
from __future__ import annotations
12
12
13
- import io
14
13
import sys
15
14
import typing as ty
16
15
import warnings
25
24
from .externals .oset import OrderedSet
26
25
27
26
if ty .TYPE_CHECKING :
27
+ import io
28
+
28
29
import numpy .typing as npt
29
30
30
31
Scalar = np .number | float
You can’t perform that action at this time.
0 commit comments