Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix root package and directory dependency editable installation #2505

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 3 additions & 1 deletion tests/masonry/builders/test_editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down