Skip to content

Commit

Permalink
fix: Work around for --no-deps failure in pip
Browse files Browse the repository at this point in the history
works around pypa/pip#7444
resolve python-poetry#1689
  • Loading branch information
Cameron Hurst committed Jan 11, 2020
1 parent 636ce8b commit 2f8c2b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions poetry/installation/pip_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def install_directory(self, package):
from poetry.utils._compat import decode
from poetry.utils.env import NullEnv
from poetry.utils.toml_file import TomlFile
from uuid import uuid4

if package.root_dir:
req = os.path.join(package.root_dir, package.source_url)
Expand Down Expand Up @@ -223,8 +224,13 @@ def install_directory(self, package):
args.append(req)

try:
random_path = os.path.join(req, 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

0 comments on commit 2f8c2b2

Please sign in to comment.