Skip to content

Commit

Permalink
fix: don't exclude files that are explicit included in wheel (python-…
Browse files Browse the repository at this point in the history
  • Loading branch information
finswimmer authored and shenek committed Dec 31, 2019
1 parent ee7431e commit 856ee89
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion poetry/masonry/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def _copy_module(self, wheel):
else:
rel_file = file.relative_to(self._path)

if self.is_excluded(rel_file.as_posix()):
if self.is_excluded(rel_file.as_posix()) and isinstance(
include, PackageInclude
):
continue

if file.suffix == ".pyc":
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license = "MIT"
readme = "README.rst"

exclude = ["**/data/", "**/*/item*"]
include = ["my_package/data/data2.txt"]

homepage = "https://python-poetry.org/"
repository = "https://github.com/python-poetry/poetry"
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 @@ -436,6 +436,7 @@ def test_src_excluded_nested_data():
assert "my-package-1.2.3/my_package/data/sub_data/data2.txt" not in names
assert "my-package-1.2.3/my_package/data/sub_data/data3.txt" not in names
assert "my-package-1.2.3/my_package/data/data1.txt" not in names
assert "my-package-1.2.3/my_package/data/data2.txt" in names
assert "my-package-1.2.3/my_package/puplic/publicdata.txt" in names
assert "my-package-1.2.3/my_package/public/item1/itemdata1.txt" not in names
assert (
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 @@ -93,6 +93,7 @@ def test_wheel_excluded_nested_data():
assert "my_package/data/sub_data/data2.txt" not in z.namelist()
assert "my_package/data/sub_data/data3.txt" not in z.namelist()
assert "my_package/data/data1.txt" not in z.namelist()
assert "my_package/data/data2.txt" in z.namelist()
assert "my_package/puplic/publicdata.txt" in z.namelist()
assert "my_package/public/item1/itemdata1.txt" not in z.namelist()
assert "my_package/public/item1/subitem/subitemdata.txt" not in z.namelist()
Expand Down

0 comments on commit 856ee89

Please sign in to comment.