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

Work around for --no-deps failure in pip #1690

Closed
wants to merge 5 commits into from
Closed
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
7 changes: 7 additions & 0 deletions poetry/installation/pip_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def create_temporary_requirement(self, package):
return name

def install_directory(self, package):
from uuid import uuid4

from poetry.masonry.builder import SdistBuilder
from poetry.factory import Factory
from poetry.utils._compat import decode
Expand Down Expand Up @@ -223,8 +225,13 @@ def install_directory(self, package):
args.append(req)

try:
random_path = os.path.join(req, "pyproject.toml" + str(uuid4()))
if pyproject.exists():
os.rename(os.path.join(req, "pyproject.toml"), random_path)
return self.run(*args)
finally:
if os.path.exists(random_path):
os.rename(random_path, os.path.join(req, "pyproject.toml"))
if not has_setup and os.path.exists(setup):
os.remove(setup)

Expand Down