diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py index 6176ab3dcf4..fd0d9c97a42 100644 --- a/src/poetry/puzzle/provider.py +++ b/src/poetry/puzzle/provider.py @@ -177,13 +177,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 @@ -218,7 +220,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: