Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not include @ when no ref is specified #5845

Merged
merged 5 commits into from
Aug 22, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Handle the @ref from the vcs_url if its in the Pipfile vcs url.
  • Loading branch information
matteius committed Aug 22, 2023
commit 7785b142b6f8ce8f4e1ace4e785ce364397a65ff
9 changes: 7 additions & 2 deletions pipenv/utils/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,13 @@ def install_req_from_pipfile(name, pipfile):
vcs = next(iter([vcs for vcs in VCS_LIST if vcs in _pipfile]), None)

if vcs:
_pipfile["vcs"] = vcs
req_str = f"{_pipfile[vcs]}{_pipfile.get('ref', '')}{extras_str}"
vcs_url = _pipfile[vcs]
fallback_ref = ""
if "@" in vcs_url:
vcs_url_parts = vcs_url.rsplit("@", 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}"
if f"{vcs}+file://" in req_str:
Expand Down
Loading