Skip to content

Commit 68d7376

Browse files
committed
Account for file directive with string in pyproject.toml
1 parent 7d35a38 commit 68d7376

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setuptools/config/pyprojecttoml.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import TYPE_CHECKING, Callable, Dict, Optional, Mapping, Set, Union
1212

1313
from setuptools.errors import FileError, OptionError
14+
from setuptools.extern.more_itertools import always_iterable
1415

1516
from . import expand as _expand
1617
from ._apply_pyprojecttoml import apply as _apply
@@ -312,8 +313,9 @@ def _expand_directive(
312313
with _ignore_errors(self.ignore_option_errors):
313314
root_dir = self.root_dir
314315
if "file" in directive:
315-
self._referenced_files.update(directive["file"])
316-
return _expand.read_files(directive["file"], root_dir)
316+
files = always_iterable(directive["file"])
317+
self._referenced_files.update(files)
318+
return _expand.read_files(files, root_dir)
317319
if "attr" in directive:
318320
return _expand.read_attr(directive["attr"], package_dir, root_dir)
319321
raise ValueError(f"invalid `{specifier}`: {directive!r}")

0 commit comments

Comments
 (0)