diff --git a/mesonpy/__init__.py b/mesonpy/__init__.py index fe7768c93..566274532 100644 --- a/mesonpy/__init__.py +++ b/mesonpy/__init__.py @@ -966,6 +966,9 @@ def sdist(self, directory: Path) -> pathlib.Path: warnings.warn( f'symbolic link pointing to a directory ignored: {name}', stacklevel=1) + # Copy `member` before starting to modify it + member = copy.copy(member) + if member.isfile(): file = meson_dist.extractfile(member.name) diff --git a/tests/packages/symlinks/meson.build b/tests/packages/symlinks/meson.build index a4cd913a3..b994b0440 100644 --- a/tests/packages/symlinks/meson.build +++ b/tests/packages/symlinks/meson.build @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: MIT -project('symlinks', version: '1.0.0') +project('symlinks') py = import('python').find_installation() diff --git a/tests/packages/symlinks/pyproject.toml b/tests/packages/symlinks/pyproject.toml index 0e67ab758..5a290eec3 100644 --- a/tests/packages/symlinks/pyproject.toml +++ b/tests/packages/symlinks/pyproject.toml @@ -5,3 +5,7 @@ [build-system] build-backend = 'mesonpy' requires = ['meson-python'] + +[project] +name = 'symlinks' +version = '1.0.0'