From a5086878c96048b3d20ab5b354369e1ac45ea033 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 | 8 ++++++-- 3 files changed, 8 insertions(+), 5 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..6e1c67b9989 100644 --- a/tests/masonry/builders/test_editable.py +++ b/tests/masonry/builders/test_editable.py @@ -23,7 +23,9 @@ def test_build_should_delegate_to_pip_for_non_pure_python_packages(tmp_dir, mock 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 0 == move.call_count @@ -38,7 +40,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