diff --git a/MANIFEST.in b/MANIFEST.in index d74bc04de..ba34af210 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include COPYING AUTHORS CHANGELOG.md requirements*.txt -include tox.ini +include tox.ini gitlab/py.typed recursive-include tests * recursive-include docs *j2 *.js *.md *.py *.rst api/*.rst Makefile make.bat diff --git a/tests/smoke/test_dists.py b/tests/smoke/test_dists.py index aa58b91b5..58ede1224 100644 --- a/tests/smoke/test_dists.py +++ b/tests/smoke/test_dists.py @@ -12,6 +12,7 @@ TEST_DIR = "tests" SDIST_FILE = f"{__title__}-{__version__}.tar.gz" WHEEL_FILE = f"{__title__.replace('-', '_')}-{__version__}-py{sys.version_info.major}-none-any.whl" +PY_TYPED = "gitlab/py.typed" @pytest.fixture(scope="session") @@ -21,19 +22,26 @@ def build(tmp_path_factory: pytest.TempPathFactory): return temp_dir -def test_sdist_includes_docs_and_tests(build: Path) -> None: +def test_sdist_includes_correct_files(build: Path) -> None: sdist = tarfile.open(build / SDIST_FILE, "r:gz") sdist_dir = f"{__title__}-{__version__}" docs_dir = sdist.getmember(f"{sdist_dir}/{DOCS_DIR}") test_dir = sdist.getmember(f"{sdist_dir}/{TEST_DIR}") readme = sdist.getmember(f"{sdist_dir}/README.rst") + py_typed = sdist.getmember(f"{sdist_dir}/{PY_TYPED}") assert docs_dir.isdir() assert test_dir.isdir() + assert py_typed.isfile() assert readme.isfile() +def test_wheel_includes_correct_files(build: Path) -> None: + wheel = zipfile.ZipFile(build / WHEEL_FILE) + assert PY_TYPED in wheel.namelist() + + def test_wheel_excludes_docs_and_tests(build: Path) -> None: wheel = zipfile.ZipFile(build / WHEEL_FILE) assert not any(file.startswith((DOCS_DIR, TEST_DIR)) for file in wheel.namelist())