Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sdist build for multiple readme files #486

Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Randy Döring <30527984+radoering@users.noreply.github.com>
  • Loading branch information
wagnerluis1982 and radoering authored Jan 8, 2023
commit 5dab89870b70333663da922d0cdc40d13f84842d
12 changes: 6 additions & 6 deletions src/poetry/core/masonry/builders/sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,21 @@ def find_files_to_add(self, exclude_build: bool = False) -> set[BuildIncludeFile
to_add = super().find_files_to_add(exclude_build)

# add any additional files, starting with all LICENSE files
additional_files: set[str | Path] = set(self._path.glob("LICENSE*"))
additional_files: set[Path] = set(self._path.glob("LICENSE*"))

# add script files
additional_files.update(self.convert_script_files())

# Include project files
additional_files.add(Path("pyproject.toml"))

# add readme files if it is specified
# add readme files if specified
if "readme" in self._poetry.local_config:
r: str | Iterable[str] = self._poetry.local_config["readme"]
if isinstance(r, str):
additional_files.add(r)
readme: str | Iterable[str] = self._poetry.local_config["readme"]
if isinstance(readme, str):
additional_files.add(Path(readme))
else:
additional_files.update(r)
additional_files.update(Path(r) for r in readme)

for additional_file in additional_files:
file = BuildIncludeFile(
Expand Down