From ca86f68b4097a0c117f8c2e590e5cdbc012e6ee1 Mon Sep 17 00:00:00 2001 From: Ashwin Nair Date: Wed, 9 Feb 2022 22:04:42 +0400 Subject: [PATCH] Fix provider.py --- src/poetry/puzzle/provider.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py index 5305dafa4a2..65f5a8519f8 100644 --- a/src/poetry/puzzle/provider.py +++ b/src/poetry/puzzle/provider.py @@ -174,13 +174,15 @@ def search_for_vcs(self, dependency: VCSDependency) -> list[Package]: if dependency in self._deferred_cache: return [self._deferred_cache[dependency]] + directory = dependency.directory if hasattr(dependency, "directory") else None + package = self.get_package_from_vcs( dependency.vcs, dependency.source, branch=dependency.branch, tag=dependency.tag, rev=dependency.rev, - directory=dependency.directory, + directory=directory, name=dependency.name, ) package.develop = dependency.develop @@ -215,7 +217,10 @@ def get_package_from_vcs( if vcs != "git": raise ValueError(f"Unsupported VCS dependency {vcs}") - suffix = url.split("/")[-1][:-4] + suffix = url.split("/")[-1] + if suffix.endswith(".git"): + suffix = suffix[:-4] + tmp_dir = Path(mkdtemp(prefix=f"pypoetry-git-{suffix}")) try: