Skip to content

Commit

Permalink
add a test for a stub-only source dist
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
  • Loading branch information
hoefling committed Feb 8, 2020
1 parent 4c33998 commit d34dfa1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/masonry/builders/test_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,21 @@ def test_proper_python_requires_if_three_digits_precision_version_specified():
parsed = p.parsestr(to_str(pkg_info))

assert parsed["Requires-Python"] == "==2.7.15"


def test_sdist_package_pep_561_stub_only():
root = fixtures_dir / "pep_561_stub_only"
poetry = Factory().create_poetry(root)

builder = SdistBuilder(poetry, NullEnv(), NullIO())
builder.build()

sdist = root / "dist" / "pep-561-stubs-0.1.tar.gz"

assert sdist.exists()

with tarfile.open(str(sdist), "r") as tar:
names = tar.getnames()
assert "pep-561-stubs-0.1/pkg-stubs/__init__.pyi" in names
assert "pep-561-stubs-0.1/pkg-stubs/module.pyi" in names
assert "pep-561-stubs-0.1/pkg-stubs/subpkg/__init__.pyi" in names

0 comments on commit d34dfa1

Please sign in to comment.