Skip to content

Commit

Permalink
Account for file directive with string in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Jan 20, 2023
1 parent 7d35a38 commit 68d7376
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setuptools/config/pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from typing import TYPE_CHECKING, Callable, Dict, Optional, Mapping, Set, Union

from setuptools.errors import FileError, OptionError
from setuptools.extern.more_itertools import always_iterable

from . import expand as _expand
from ._apply_pyprojecttoml import apply as _apply
Expand Down Expand Up @@ -312,8 +313,9 @@ def _expand_directive(
with _ignore_errors(self.ignore_option_errors):
root_dir = self.root_dir
if "file" in directive:
self._referenced_files.update(directive["file"])
return _expand.read_files(directive["file"], root_dir)
files = always_iterable(directive["file"])
self._referenced_files.update(files)
return _expand.read_files(files, root_dir)
if "attr" in directive:
return _expand.read_attr(directive["attr"], package_dir, root_dir)
raise ValueError(f"invalid `{specifier}`: {directive!r}")
Expand Down

0 comments on commit 68d7376

Please sign in to comment.