Skip to content

Commit

Permalink
fix: tests & file inclusion update
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Aug 22, 2023
1 parent d98198d commit 11b821a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
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, PosixPurePath

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

0 comments on commit 11b821a

Please sign in to comment.