Commit 417d01d2 by Sébastien Eustace

Fix an error when building distributions with exclude

parent 140d16a5
......@@ -5,6 +5,7 @@
### Fixed
- Fixed executables from outside the virtualenv not being accessible.
- Fixed a possible error when building distributions with the `exclude` option.
## [0.12.8] - 2018-11-13
......
......@@ -53,7 +53,7 @@ class Builder(object):
explicitely_excluded = set()
for excluded_glob in self._package.exclude:
for excluded in self._path.glob(excluded_glob):
for excluded in self._path.glob(str(excluded_glob)):
explicitely_excluded.add(excluded.relative_to(self._path).as_posix())
ignored = vcs_ignored_files | explicitely_excluded
......
from poetry.io import NullIO
from poetry.masonry.builders.builder import Builder
from poetry.poetry import Poetry
from poetry.utils._compat import Path
from poetry.utils.env import NullEnv
def test_builder_find_excluded_files(mocker):
p = mocker.patch("poetry.vcs.git.Git.get_ignored_files")
p.return_value = []
builder = Builder(
Poetry.create(Path(__file__).parent / "fixtures" / "complete"),
NullEnv(),
NullIO(),
)
assert builder.find_excluded_files() == {"my_package/sub_pkg1/extra_file.xml"}
......@@ -163,6 +163,8 @@ def test_complete():
zip = zipfile.ZipFile(str(whl))
try:
assert "my_package/sub_pgk1/extra_file.xml" not in zip.namelist()
entry_points = zip.read("my_package-1.2.3.dist-info/entry_points.txt")
assert (
......
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