Skip to content

Commit

Permalink
Pass editable for vcs when specified (#5928)
Browse files Browse the repository at this point in the history
  • Loading branch information
matteius committed Sep 8, 2023
1 parent 9d470b4 commit d54f11e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pipenv/utils/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ def install_req_from_pipfile(name, pipfile):
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:
if f"{vcs}+file://" in req_str or _pipfile.get("editable", False):
req_str = (
f"-e {req_str}#egg={name}{extras_str}{subdirectory.replace('#', '&')}"
)
Expand Down
6 changes: 5 additions & 1 deletion pipenv/utils/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ def requirement_from_lockfile(
include_vcs = "" if f"{vcs}+" in url else f"{vcs}+"
egg_fragment = "" if "#egg=" in url else f"#egg={package_name}"
ref_str = "" if not ref or f"@{ref}" in url else f"@{ref}"
if is_editable_path(url) or "file://" in url:
if (
is_editable_path(url)
or "file://" in url
or package_info.get("editable", False)
):
pip_line = f"-e {include_vcs}{url}{ref_str}{egg_fragment}{extras}"
pip_line += f"&subdirectory={subdirectory}" if subdirectory else ""
else:
Expand Down

0 comments on commit d54f11e

Please sign in to comment.