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 Dec 7, 2019
1 parent e943a4e commit 467e175
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 @@ -176,6 +176,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 @@ -218,8 +219,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 467e175

Please sign in to comment.