diff --git a/src/poetry/core/masonry/builders/wheel.py b/src/poetry/core/masonry/builders/wheel.py index 34da6eceb..c8fe8af65 100644 --- a/src/poetry/core/masonry/builders/wheel.py +++ b/src/poetry/core/masonry/builders/wheel.py @@ -169,7 +169,7 @@ def _build(self, wheel: zipfile.ZipFile) -> None: build_dir = self._path / "build" lib = list(build_dir.glob("lib.*")) - if not lib: + if self._editable or not lib: # The result of building the extensions # does not exist, this may due to conditional # builds, so we assume that it's okay @@ -201,6 +201,15 @@ def _copy_file_scripts(self, wheel: zipfile.ZipFile) -> None: ) def _run_build_command(self, setup: Path) -> None: + if self._editable: + subprocess.check_call( + [ + self.executable.as_posix(), + str(setup), + "build_ext", + "--inplace", + ] + ) subprocess.check_call( [ self.executable.as_posix(),