From 2f8c2b2c2c0215c87bdc9f5a1b2a5c7d6691c29e Mon Sep 17 00:00:00 2001 From: Cameron Hurst Date: Fri, 6 Dec 2019 21:15:48 -0500 Subject: [PATCH 1/5] fix: Work around for --no-deps failure in pip works around https://github.com/pypa/pip/issues/7444 resolve #1689 --- poetry/installation/pip_installer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index aada0cd0190..4392c61f212 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -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) @@ -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) From 4e94bdeab7afc9450ca8ed2349e88ec51024d415 Mon Sep 17 00:00:00 2001 From: Cameron Hurst Date: Sat, 7 Dec 2019 08:51:04 -0500 Subject: [PATCH 2/5] fix: append nonce rather than make nonce --- poetry/installation/pip_installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index 4392c61f212..862196a10e8 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -224,7 +224,7 @@ def install_directory(self, package): args.append(req) try: - random_path = os.path.join(req, str(uuid4())) + 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) From 4a3af185752d1600360528ac0ebf4d8aa04d2ca0 Mon Sep 17 00:00:00 2001 From: Cameron Hurst Date: Sat, 7 Dec 2019 08:51:56 -0500 Subject: [PATCH 3/5] fix: import ordering inside function --- poetry/installation/pip_installer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index 862196a10e8..40abcdd1771 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -176,12 +176,13 @@ 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 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) From 6519fd41b4ff0d656cd748543bc6489f918c4e48 Mon Sep 17 00:00:00 2001 From: Cameron Hurst Date: Sat, 7 Dec 2019 09:02:34 -0500 Subject: [PATCH 4/5] refactor: linting --- poetry/installation/pip_installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index 40abcdd1771..aa4cf59b97e 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -225,7 +225,7 @@ def install_directory(self, package): args.append(req) try: - random_path = os.path.join(req,"pyproject.toml", str(uuid4())) + 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) From 88d09bbc97a94087156bb21543df11a076b0da3d Mon Sep 17 00:00:00 2001 From: Cameron Hurst Date: Thu, 12 Dec 2019 15:12:09 -0500 Subject: [PATCH 5/5] fix: rename should be append to file not a folder --- poetry/installation/pip_installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry/installation/pip_installer.py b/poetry/installation/pip_installer.py index aa4cf59b97e..94fd6edcd74 100644 --- a/poetry/installation/pip_installer.py +++ b/poetry/installation/pip_installer.py @@ -225,7 +225,7 @@ def install_directory(self, package): args.append(req) try: - random_path = os.path.join(req, "pyproject.toml", str(uuid4())) + 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)