Skip to content

Commit

Permalink
Fix for including modules from different locations
Browse files Browse the repository at this point in the history
When we define multiple packages from different source locations,
Poetry currently only uses the last specified from= location.
This patch adds explicit paths to package_dir for additional packages.

This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354,
and possibly even python-poetry/poetry#2450.
  • Loading branch information
jaharkes committed Nov 16, 2020
1 parent 727907d commit e291124
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion poetry/core/masonry/builders/sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,14 @@ def build_setup(self): # type: () -> bytes
pkg_dir, _packages, _package_data = self.find_packages(include)

if pkg_dir is not None:
package_dir[""] = os.path.relpath(pkg_dir, str(self._path))
pkg_root = os.path.relpath(pkg_dir, str(self._path))
if "" in package_dir:
package_dir.update(
(p, os.path.join(pkg_root, p.replace(".", "/")))
for p in _packages
)
else:
package_dir[""] = pkg_root

packages += [p for p in _packages if p not in packages]
package_data.update(_package_data)
Expand Down

0 comments on commit e291124

Please sign in to comment.