diff --git a/poetry/factory.py b/poetry/factory.py index 90c9cec3295..0b472f4bd67 100644 --- a/poetry/factory.py +++ b/poetry/factory.py @@ -30,7 +30,7 @@ class Factory: """ def create_poetry( - self, cwd=None, io=None + self, cwd=None, io=None, original_root=None, ): # type: (Optional[Path], Optional[IO]) -> Poetry if io is None: io = NullIO() @@ -57,7 +57,7 @@ def create_poetry( name = local_config["name"] version = local_config["version"] package = ProjectPackage(name, version, version) - package.root_dir = poetry_file.parent + package.root_dir = original_root or poetry_file.parent for author in local_config["authors"]: package.authors.append(author) diff --git a/poetry/masonry/builders/complete.py b/poetry/masonry/builders/complete.py index 6339f9351b5..af96816aab9 100644 --- a/poetry/masonry/builders/complete.py +++ b/poetry/masonry/builders/complete.py @@ -43,7 +43,9 @@ def build(self): with self.unpacked_tarball(sdist_file) as tmpdir: WheelBuilder.make_in( - Factory().create_poetry(tmpdir), + Factory().create_poetry( + tmpdir, original_root=self._poetry.file.path.parent + ), self._env, self._io, dist_dir, @@ -52,7 +54,9 @@ def build(self): else: with self.unpacked_tarball(sdist_file) as tmpdir: WheelBuilder.make_in( - Factory().create_poetry(tmpdir), + Factory().create_poetry( + tmpdir, original_root=self._poetry.file.path.parent + ), self._env, self._io, dist_dir,