Commit dbe2c380 by finswimmer Committed by Sébastien Eustace

fix: don't exclude files that are explicit included in wheel (#1336) (#1750)

parent 6c3d357a
......@@ -153,7 +153,9 @@ class WheelBuilder(Builder):
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":
......
......@@ -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"
......
......@@ -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 (
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment