From a952e87d055a3fb40330a003910c4b4e9781bc08 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Thu, 2 Apr 2026 11:50:18 -0600 Subject: [PATCH 1/2] Work around typing issue from more_itertools --- setuptools/config/expand.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setuptools/config/expand.py b/setuptools/config/expand.py index d9a2ded430..4fdb2475f5 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)) + _filepaths = (os.path.join(root_dir, path) for path in + # work around more_itertools/more_itertools#1143 + cast('Iterable[StrPath]', always_iterable(filepaths))) return '\n'.join( _read_file(path) for path in _filter_existing_files(_filepaths) From b936ba7ca2a226a8b32eabec81d8877e309f5363 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Thu, 2 Apr 2026 12:03:41 -0600 Subject: [PATCH 2/2] reformat slightly --- setuptools/config/expand.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setuptools/config/expand.py b/setuptools/config/expand.py index 4fdb2475f5..b581515202 100644 --- a/setuptools/config/expand.py +++ b/setuptools/config/expand.py @@ -122,9 +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 - # work around more_itertools/more_itertools#1143 - cast('Iterable[StrPath]', 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)