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: tests & file inclusion update #661

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/changelog.rst

This file was deleted.

1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../CHANGELOG.rst
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
30 changes: 22 additions & 8 deletions tests/test_self_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,43 @@
import tarfile
import zipfile

from pathlib import Path
from pathlib import Path, PurePosixPath

import pytest


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(PurePosixPath(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',
Expand Down