Skip to content

Commit

Permalink
Fix root package and directory dependency editable installation
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed Jun 5, 2020
1 parent 6ea3849 commit a508687
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions poetry/installation/pip_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion poetry/masonry/builders/editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down
8 changes: 6 additions & 2 deletions tests/masonry/builders/test_editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a508687

Please sign in to comment.