Skip to content

Commit

Permalink
local support for git dependencies working
Browse files Browse the repository at this point in the history
  • Loading branch information
saikonen committed Sep 29, 2023
1 parent 83413b4 commit 6c590d0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions metaflow/plugins/pypi/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,19 @@ def solve(self, id_, packages, python, platform):
else:
cmd.append(f"{package}=={version}")
self._call(prefix, cmd)

def _format_download_url(item):
dl_info = item["download_info"]
res = {k: v for k, v in dl_info.items() if k in ["url"]}
# reconstruct the VCS url and pin to current commit_id
# so using @branch as a version acts somewhat as expected.
vcs_info = dl_info.get("vcs_info")
if vcs_info:
res["url"] = "{vcs}+{url}@{commit_id}".format(**vcs_info, **res)
return res

with open(report, mode="r", encoding="utf-8") as f:
return [
{k: v for k, v in item["download_info"].items() if k in ["url"]}
for item in json.load(f)["install"]
]
return [_format_download_url(item) for item in json.load(f)["install"]]

def download(self, id_, packages, python, platform):
prefix = self.micromamba.path_to_environment(id_)
Expand Down

0 comments on commit 6c590d0

Please sign in to comment.