From d95885dc0f773bdc5e8de07701f49502c79ed86d Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Mon, 5 May 2025 14:39:49 +0200 Subject: [PATCH] MAINT: avoid warnings because of symlinks pointing outside repo --- .gitattributes | 8 ++++++++ tests/test_sdist.py | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..82c834a7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: 2025 The meson-python developers +# +# SPDX-License-Identifier: MIT + +# These test files contain symlinks to outside the repo (hence invalid - on +# purpose) so exclude them to prevent warnings. See gh-728 for context. +tests/packages/symlinks/baz.py export-ignore +tests/packages/symlinks/qux.py export-ignore diff --git a/tests/test_sdist.py b/tests/test_sdist.py index 78150d16..bc598d91 100644 --- a/tests/test_sdist.py +++ b/tests/test_sdist.py @@ -223,6 +223,10 @@ def test_symlinks(tmp_path, sdist_symlinks): names = {member.name for member in sdist.getmembers()} mtimes = {member.mtime for member in sdist.getmembers()} + # Check that the symlinks `baz.py` and `qux.py` pointing outside the + # source tree are not included. These files are present in the + # meson-python git repository but cannot be included in the meson-python + # sdist. Thus this test is effective only when run from a git checkout. assert names == { 'symlinks-1.0.0/PKG-INFO', 'symlinks-1.0.0/meson.build',