Skip to content
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
8 changes: 7 additions & 1 deletion poetry/core/masonry/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ def __init__(

packages = []
for p in self._package.packages:
formats = p.get("format", [])
formats = p.get("format") or None

# Default to including the package in both sdist & wheel
# if the `format` key is not provided in the inline include table.
if formats is None:
formats = ["sdist", "wheel"]

if not isinstance(formats, list):
formats = [formats]

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ packages = [

include = [
{ path = "tests", format = "sdist" },
{ path = "both.txt" },
{ path = "wheel_only.txt", format = "wheel" }
]

Expand Down
1 change: 1 addition & 0 deletions tests/masonry/builders/test_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ def test_includes_with_inline_table():
assert sdist.exists()

with tarfile.open(str(sdist), "r") as tar:
assert "with-include-1.2.3/both.txt" in tar.getnames()
assert "with-include-1.2.3/wheel_only.txt" not in tar.getnames()
assert "with-include-1.2.3/tests/__init__.py" in tar.getnames()
assert "with-include-1.2.3/tests/test_foo/test.py" in tar.getnames()
Expand Down
1 change: 1 addition & 0 deletions tests/masonry/builders/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def test_wheel_includes_inline_table():
assert whl.exists()

with zipfile.ZipFile(str(whl)) as z:
assert "both.txt" in z.namelist()
assert "wheel_only.txt" in z.namelist()
assert "notes.txt" not in z.namelist()

Expand Down