Skip to content

Commit b928639

Browse files
nejchJohnVillalovos
authored andcommitted
fix(build): include py.typed in dists
1 parent 9270e10 commit b928639

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
include COPYING AUTHORS CHANGELOG.md requirements*.txt
2-
include tox.ini
2+
include tox.ini gitlab/py.typed
33
recursive-include tests *
44
recursive-include docs *j2 *.js *.md *.py *.rst api/*.rst Makefile make.bat

tests/smoke/test_dists.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
TEST_DIR = "tests"
1313
SDIST_FILE = f"{__title__}-{__version__}.tar.gz"
1414
WHEEL_FILE = f"{__title__.replace('-', '_')}-{__version__}-py{sys.version_info.major}-none-any.whl"
15+
PY_TYPED = "gitlab/py.typed"
1516

1617

1718
@pytest.fixture(scope="session")
@@ -21,19 +22,26 @@ def build(tmp_path_factory: pytest.TempPathFactory):
2122
return temp_dir
2223

2324

24-
def test_sdist_includes_docs_and_tests(build: Path) -> None:
25+
def test_sdist_includes_correct_files(build: Path) -> None:
2526
sdist = tarfile.open(build / SDIST_FILE, "r:gz")
2627
sdist_dir = f"{__title__}-{__version__}"
2728

2829
docs_dir = sdist.getmember(f"{sdist_dir}/{DOCS_DIR}")
2930
test_dir = sdist.getmember(f"{sdist_dir}/{TEST_DIR}")
3031
readme = sdist.getmember(f"{sdist_dir}/README.rst")
32+
py_typed = sdist.getmember(f"{sdist_dir}/{PY_TYPED}")
3133

3234
assert docs_dir.isdir()
3335
assert test_dir.isdir()
36+
assert py_typed.isfile()
3437
assert readme.isfile()
3538

3639

40+
def test_wheel_includes_correct_files(build: Path) -> None:
41+
wheel = zipfile.ZipFile(build / WHEEL_FILE)
42+
assert PY_TYPED in wheel.namelist()
43+
44+
3745
def test_wheel_excludes_docs_and_tests(build: Path) -> None:
3846
wheel = zipfile.ZipFile(build / WHEEL_FILE)
3947
assert not any(file.startswith((DOCS_DIR, TEST_DIR)) for file in wheel.namelist())

0 commit comments

Comments
 (0)