Handle edge case where it is expected ssh:// urls to have at least one @ symbol (#5851)

* Handle edge case where it is expected ssh:// urls to have at least one @ symbol

* add news fragment
This commit is contained in:
Matt Davis
2023-08-22 06:25:36 -04:00
committed by GitHub
parent c8f446510e
commit 31c98f3c7d
3 changed files with 7 additions and 2 deletions
+1
View File
@@ -0,0 +1 @@
Fix regression with ``ssh://`` vcs URLs introduced in ``2023.8.21`` whereby ssh vcs URLs are expected to have at least one ``@`` symbol.
+3 -1
View File
@@ -977,7 +977,9 @@ def install_req_from_pipfile(name, pipfile):
if vcs:
vcs_url = _pipfile[vcs]
fallback_ref = ""
if "@" in vcs_url:
if ("ssh://" in vcs_url and vcs_url.count("@") >= 2) or (
"ssh://" not in vcs_url and "@" in vcs_url
):
vcs_url_parts = vcs_url.rsplit("@", 1)
vcs_url = vcs_url_parts[0]
fallback_ref = vcs_url_parts[1]
+3 -1
View File
@@ -156,7 +156,9 @@ def requirement_from_lockfile(
if vcs in package_info:
url = package_info[vcs]
ref = package_info.get("ref", "")
if "@" in url:
if ("ssh://" in url and url.count("@") >= 2) or (
"ssh://" not in url and "@" in url
):
url_parts = url.rsplit("@", 1)
url = url_parts[0]
if not ref: