Pass editable for vcs when specified (#5928)

This commit is contained in:
Matt Davis
2023-09-08 08:41:15 -04:00
committed by GitHub
parent 9d470b4444
commit d54f11e170
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -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('#', '&')}"
)
+5 -1
View File
@@ -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: