Commit c426d51e by Sébastien Eustace

Fix an error when building wheels with packages set

Co-authored-by: Sébastien Eustace <555648+sdispater@users.noreply.github.com>
Co-authored-by: Nikita Grishko <1087619+Gr1N@users.noreply.github.com>
parent 7c57995a
......@@ -6,6 +6,7 @@
- Fixed wrong wheel being selected when resolving dependencies.
- Fixed an error when publishing.
- Fixed an error when building wheels with the `packages` property set.
## [0.11.3] - 2018-07-26
......
......@@ -19,9 +19,9 @@ class Include(object):
def __init__(self, base, include): # type: (Path, str) -> None
self._base = base
self._include = include
self._include = str(include)
self._elements = sorted(list(self._base.glob(str(self._include))))
self._elements = sorted(list(self._base.glob(self._include)))
@property
def base(self): # type: () -> Path
......
......@@ -83,3 +83,42 @@ def test_wheel_module_src():
with zipfile.ZipFile(str(whl)) as z:
assert "module_src.py" in z.namelist()
def test_package_with_include(mocker):
# Patch git module to return specific excluded files
p = mocker.patch("poetry.vcs.git.Git.get_ignored_files")
p.return_value = [
str(
Path(__file__).parent
/ "fixtures"
/ "with-include"
/ "extra_dir"
/ "vcs_excluded.txt"
),
str(
Path(__file__).parent
/ "fixtures"
/ "with-include"
/ "extra_dir"
/ "sub_pkg"
/ "vcs_excluded.txt"
),
]
module_path = fixtures_dir / "with-include"
WheelBuilder.make(Poetry.create(str(module_path)), NullVenv(), NullIO())
whl = module_path / "dist" / "with_include-1.2.3-py3-none-any.whl"
assert whl.exists()
with zipfile.ZipFile(str(whl)) as z:
names = z.namelist()
assert "with_include-1.2.3.dist-info/LICENSE" in names
assert "extra_dir/__init__.py" in names
assert "extra_dir/vcs_excluded.txt" in names
assert "extra_dir/sub_pkg/__init__.py" in names
assert "extra_dir/sub_pkg/vcs_excluded.txt" not in names
assert "my_module.py" in names
assert "notes.txt" in names
assert "package_with_include/__init__.py" in names
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