diff --git a/poetry/core/masonry/builders/sdist.py b/poetry/core/masonry/builders/sdist.py index 981b63b2a..76809170d 100644 --- a/poetry/core/masonry/builders/sdist.py +++ b/poetry/core/masonry/builders/sdist.py @@ -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)