def _parse_url(self) -> None: if self.url.startswith("git@"): self.url = add_ssh_scheme_to_git_uri(self.url) if not self.name: self._parse_name_from_url() repo = url_without_fragments(self.url) ref = None parsed = urlparse.urlparse(repo) if "@" in parsed.path: path, ref = parsed.path.split("@", 1) repo = urlparse.urlunparse(parsed._replace(path=path)) self.repo, self.ref = repo, ref
def _parse_url(self) -> None: vcs, url_no_vcs = self.url.split("+", 1) if url_no_vcs.startswith("git@"): url_no_vcs = add_ssh_scheme_to_git_uri(url_no_vcs) self.url = f"{vcs}+{url_no_vcs}" if not self.name: self._parse_name_from_url() repo = url_without_fragments(url_no_vcs) ref = None parsed = urlparse.urlparse(repo) if "@" in parsed.path: path, ref = parsed.path.split("@", 1) repo = urlparse.urlunparse(parsed._replace(path=path)) self.repo, self.ref = repo, ref
def _parse_url(self) -> None: if self.url.startswith("git@"): self.url = add_ssh_scheme_to_git_uri(self.url) if not self.name: self._parse_name_from_url() if not self.name: raise RequirementError("VCS requirement must provide a 'egg=' fragment.") repo = url_without_fragments(self.url) ref = None parsed = urlparse.urlparse(repo) if "@" in parsed.path: path, ref = parsed.path.split("@", 1) repo = urlparse.urlunparse(parsed._replace(path=path)) self.repo, self.ref = repo, ref
def _parse_url(self) -> None: vcs, url_no_vcs = self.url.split("+", 1) if url_no_vcs.startswith("git@"): url_no_vcs = add_ssh_scheme_to_git_uri(url_no_vcs) if not self.name: self._parse_name_from_url() ref = self.ref parsed = urlparse.urlparse(url_no_vcs) path = parsed.path fragments = dict(urlparse.parse_qsl(parsed.fragment)) if "subdirectory" in fragments: self.subdirectory = fragments["subdirectory"] if "@" in parsed.path: path, ref = parsed.path.split("@", 1) repo = urlparse.urlunparse(parsed._replace(path=path, fragment="")) self.url = f"{vcs}+{repo}" self.repo, self.ref = repo, ref # type: ignore