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

fix: get commit id from requested revision when it is missing #5193

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
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
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
Loading