Skip to content

Commit

Permalink
Add generated files to sdist
Browse files Browse the repository at this point in the history
  • Loading branch information
lithomas1 committed Oct 15, 2022
1 parent d18930f commit a740523
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,9 @@ def sdist(self, directory: Path) -> pathlib.Path:
path = self._source_dir.joinpath(*member_parts[1:])

if not path.is_file():
# Could be a generated file, we still need to copy in that case
if member.isfile():
tar.addfile(member, meson_dist.extractfile(member.name))
continue

info = tarfile.TarInfo(member.name)
Expand All @@ -912,6 +915,7 @@ def sdist(self, directory: Path) -> pathlib.Path:
info.mode = int(oct(file_stat.st_mode)[-3:], 8)

# rewrite the path if necessary, to match the sdist distribution name
#print("File is:", path)
if dist_name != meson_dist_name:
info.name = pathlib.Path(
dist_name,
Expand Down

0 comments on commit a740523

Please sign in to comment.