diff --git a/pyproject.toml b/pyproject.toml index ece49090..9ca98aeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,7 @@ build = "build.__main__:entrypoint" [tool.flit.sdist] include = ["tests/", ".gitignore", "CHANGELOG.rst", "docs/", ".dockerignore", "tox.ini"] -exclude = ["**/__pycache__", "docs/_build"] +exclude = ["**/__pycache__", "docs/_build", "**/*.egg-info", "tests/packages/*/build"] [tool.coverage.run] diff --git a/tests/test_self_packaging.py b/tests/test_self_packaging.py index f369bbb0..c618a802 100644 --- a/tests/test_self_packaging.py +++ b/tests/test_self_packaging.py @@ -5,7 +5,7 @@ import tarfile import zipfile -from pathlib import Path +from pathlib import Path, PosixPurePath import pytest @@ -13,21 +13,35 @@ DIR = Path(__file__).parent.resolve() MAIN_DIR = DIR.parent + sdist_files = { + '.dockerignore', + '.gitignore', + 'CHANGELOG.rst', 'LICENSE', 'PKG-INFO', 'README.md', + 'docs/conf.py', 'pyproject.toml', - 'src/build/__init__.py', - 'src/build/__main__.py', - 'src/build/_exceptions.py', - 'src/build/_importlib.py', - 'src/build/_util.py', - 'src/build/env.py', 'src/build/py.typed', - 'src/build/util.py', + 'tests/constraints.txt', + 'tests/packages/test-cant-build-via-sdist/some-file-that-is-needed-for-build.txt', + 'tests/packages/test-no-project/empty.txt', + 'tox.ini', +} + +sdist_patterns = { + 'docs/*.rst', + 'src/build/*.py', + 'tests/*.py', + 'tests/packages/*/*.py', + 'tests/packages/*/*/*.py', + 'tests/packages/*/pyproject.toml', + 'tests/packages/*/setup.*', } +sdist_files |= {str(PosixPurePath(p.relative_to(MAIN_DIR))) for path in sdist_patterns for p in MAIN_DIR.glob(path)} + wheel_files = { 'build/__init__.py', 'build/__main__.py',