diff --git a/setuptools/config/expand.py b/setuptools/config/expand.py index d9a2ded430..b581515202 100644 --- a/setuptools/config/expand.py +++ b/setuptools/config/expand.py @@ -32,7 +32,7 @@ from itertools import chain from pathlib import Path from types import ModuleType, TracebackType -from typing import TYPE_CHECKING, Any, Callable, TypeVar +from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast from .. import _static from .._path import StrPath, same_path as _same_path @@ -122,7 +122,9 @@ def read_files( from more_itertools import always_iterable root_dir = os.path.abspath(root_dir or os.getcwd()) - _filepaths = (os.path.join(root_dir, path) for path in always_iterable(filepaths)) + # work around more_itertools/more_itertools#1143 + _filepaths = cast('Iterable[StrPath]', always_iterable(filepaths)) + _filepaths = (os.path.join(root_dir, path) for path in _filepaths) return '\n'.join( _read_file(path) for path in _filter_existing_files(_filepaths)