Skip to content

Commit

Permalink
fix: get commit id from requested revision when it is missing (#5193)
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Jan 22, 2025
1 parent 32571ff commit 5396879
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bentoml/_internal/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def get_bentoml_requirement() -> str | None:
if direct_url_data.get("dir_info", {}).get("editable", False):
return None
if vcs_info := direct_url_data.get("vcs_info", None):
res = f"bentoml @ {vcs_info['vcs']}+{direct_url_data['url']}@{vcs_info['commit_id']}"
# NOTE: uv 0.5.22 installs direct_url.json without commit_id key
# This is a workaround to handle this case and should be removed in future
commit_id = vcs_info.get("commit_id") or vcs_info.get("requested_revision")
res = f"bentoml @ {vcs_info['vcs']}+{direct_url_data['url']}@{commit_id}"
else:
res = f"bentoml @ {direct_url_data['url']}"
if subdirectory := direct_url_data.get("subdirectory", None):
Expand Down

0 comments on commit 5396879

Please sign in to comment.