From 777233a6de7e6faec3c1f0970466096cd3ce3cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Eustace?= Date: Fri, 5 Jun 2020 18:53:30 +0200 Subject: [PATCH] Fix root package and directory dependency editable installation --- poetry/installation/pip_installer.py | 3 +-- poetry/masonry/builders/editable.py | 2 +- tests/masonry/builders/test_editable.py | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index 331a69b580e..349f222c73c 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -181,7 +181,6 @@ def create_temporary_requirement(self, package): def install_directory(self, package): from poetry.factory import Factory - from poetry.utils.env import NullEnv from poetry.utils.toml_file import TomlFile if package.root_dir: @@ -215,7 +214,7 @@ def install_directory(self, package): from poetry.masonry.builders.editable import EditableBuilder builder = EditableBuilder( - Factory().create_poetry(pyproject.parent), NullEnv(), NullIO() + Factory().create_poetry(pyproject.parent), self._env, NullIO() ) builder.build() diff --git a/poetry/masonry/builders/editable.py b/poetry/masonry/builders/editable.py index 1757bd4ff3d..15cfe53676a 100644 --- a/poetry/masonry/builders/editable.py +++ b/poetry/masonry/builders/editable.py @@ -38,7 +38,7 @@ def _setup_build(self): str(self._poetry.file), str(self._poetry.file.with_suffix(".tmp")) ) try: - self._env.run_pip("install", "-e", str(self._path)) + self._env.run_pip("install", "--no-deps", "-e", str(self._path)) finally: shutil.move( str(self._poetry.file.with_suffix(".tmp")), diff --git a/tests/masonry/builders/test_editable.py b/tests/masonry/builders/test_editable.py index d1121243ca4..a067db46ea2 100644 --- a/tests/masonry/builders/test_editable.py +++ b/tests/masonry/builders/test_editable.py @@ -38,7 +38,9 @@ def test_build_should_temporarily_remove_the_pyproject_file(tmp_dir, mocker): builder = EditableBuilder(Factory().create_poetry(module_path), env, NullIO()) builder.build() - expected = [[sys.executable, "-m", "pip", "install", "-e", str(module_path)]] + expected = [ + [sys.executable, "-m", "pip", "install", "--no-deps", "-e", str(module_path)] + ] assert expected == env.executed assert 2 == move.call_count