Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/5849.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
More gracefully handle @ symbols in vcs URLs to address recent regression with vcs URLs.
5 changes: 3 additions & 2 deletions pipenv/utils/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,9 @@ def install_req_from_pipfile(name, pipfile):
"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]
if re.match(r"^[\w\.]+$", vcs_url_parts[1]):
vcs_url = vcs_url_parts[0]
fallback_ref = vcs_url_parts[1]
req_str = f"{vcs_url}@{_pipfile.get('ref', fallback_ref)}{extras_str}"
if not req_str.startswith(f"{vcs}+"):
req_str = f"{vcs}+{req_str}"
Expand Down
8 changes: 5 additions & 3 deletions pipenv/utils/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ def requirement_from_lockfile(
"ssh://" not in url and "@" in url
):
url_parts = url.rsplit("@", 1)
url = url_parts[0]
if not ref:
ref = url_parts[1]
# Check if the second part matches the criteria to be a ref (vcs URLs would likely have a /)
if re.match(r"^[\w\.]+$", url_parts[1]):
url = url_parts[0]
if not ref:
ref = url_parts[1]

extras = (
"[{}]".format(",".join(package_info.get("extras", [])))
Expand Down