diff --git a/pip_check_reqs/common.py b/pip_check_reqs/common.py index 281ab11..755c0fd 100644 --- a/pip_check_reqs/common.py +++ b/pip_check_reqs/common.py @@ -10,11 +10,7 @@ from dataclasses import dataclass, field from importlib.util import find_spec from pathlib import Path -from typing import ( - Callable, - Generator, - Iterable, -) +from typing import TYPE_CHECKING, Callable from packaging.markers import Marker from packaging.utils import NormalizedName, canonicalize_name @@ -24,6 +20,9 @@ from . import __version__ +if TYPE_CHECKING: + from collections.abc import Generator, Iterable + log = logging.getLogger(__name__) diff --git a/pip_check_reqs/find_extra_reqs.py b/pip_check_reqs/find_extra_reqs.py index 04abd32..371885f 100644 --- a/pip_check_reqs/find_extra_reqs.py +++ b/pip_check_reqs/find_extra_reqs.py @@ -10,7 +10,7 @@ import sys from functools import cache from pathlib import Path -from typing import TYPE_CHECKING, Callable, Iterable +from typing import TYPE_CHECKING, Callable from unittest import mock from packaging.utils import NormalizedName, canonicalize_name @@ -23,6 +23,8 @@ from pip_check_reqs.common import version_info if TYPE_CHECKING: + from collections.abc import Iterable + from pip._internal.req.req_file import ParsedRequirement log = logging.getLogger(__name__) diff --git a/pip_check_reqs/find_missing_reqs.py b/pip_check_reqs/find_missing_reqs.py index 8072727..7363216 100644 --- a/pip_check_reqs/find_missing_reqs.py +++ b/pip_check_reqs/find_missing_reqs.py @@ -10,7 +10,7 @@ import sys from functools import cache from pathlib import Path -from typing import Callable, Iterable +from typing import TYPE_CHECKING, Callable from unittest import mock from packaging.utils import NormalizedName, canonicalize_name @@ -25,6 +25,9 @@ from pip_check_reqs import common from pip_check_reqs.common import FoundModule, version_info +if TYPE_CHECKING: + from collections.abc import Iterable + log = logging.getLogger(__name__)