Skip to content

Commit 33106f1

Browse files
committed
Remove StrIter
1 parent c5fa403 commit 33106f1

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

setuptools/discovery.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@
4141

4242
import itertools
4343
import os
44+
from collections.abc import Iterator
4445
from fnmatch import fnmatchcase
4546
from glob import glob
4647
from pathlib import Path
47-
from typing import TYPE_CHECKING, Iterable, Iterator, Mapping
48+
from typing import TYPE_CHECKING, Iterable, Mapping
4849

4950
import _distutils_hack.override # noqa: F401
5051

@@ -54,11 +55,8 @@
5455
from distutils.util import convert_path
5556

5657
if TYPE_CHECKING:
57-
from typing_extensions import TypeAlias
58-
5958
from setuptools import Distribution
6059

61-
StrIter: TypeAlias = Iterator[str]
6260
chain_iter = itertools.chain.from_iterable
6361

6462

@@ -125,7 +123,9 @@ def find(
125123
)
126124

127125
@classmethod
128-
def _find_iter(cls, where: StrPath, exclude: _Filter, include: _Filter) -> StrIter:
126+
def _find_iter(
127+
cls, where: StrPath, exclude: _Filter, include: _Filter
128+
) -> Iterator[str]:
129129
raise NotImplementedError
130130

131131

@@ -137,7 +137,9 @@ class PackageFinder(_Finder):
137137
ALWAYS_EXCLUDE = ("ez_setup", "*__pycache__")
138138

139139
@classmethod
140-
def _find_iter(cls, where: StrPath, exclude: _Filter, include: _Filter) -> StrIter:
140+
def _find_iter(
141+
cls, where: StrPath, exclude: _Filter, include: _Filter
142+
) -> Iterator[str]:
141143
"""
142144
All the packages found in 'where' that pass the 'include' filter, but
143145
not the 'exclude' filter.
@@ -186,7 +188,9 @@ class ModuleFinder(_Finder):
186188
"""
187189

188190
@classmethod
189-
def _find_iter(cls, where: StrPath, exclude: _Filter, include: _Filter) -> StrIter:
191+
def _find_iter(
192+
cls, where: StrPath, exclude: _Filter, include: _Filter
193+
) -> Iterator[str]:
190194
for file in glob(os.path.join(where, "*.py")):
191195
module, _ext = os.path.splitext(os.path.basename(file))
192196

0 commit comments

Comments
 (0)