Skip to content

Commit

Permalink
fix: handle ssh git url without ref part (#4716)
Browse files Browse the repository at this point in the history
* fix: handle ssh git url without ref part

Signed-off-by: Frost Ming <me@frostming.com>

* fix: handle empty specifier

Signed-off-by: Frost Ming <me@frostming.com>

---------

Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed May 8, 2024
1 parent 614e8f4 commit 09db40b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bentoml/_internal/bento/build_config.py
Expand Up @@ -679,7 +679,9 @@ def _fix_dep_urls(self, requirements_txt: str, wheels_folder: str) -> None:
filename = link.filename
elif link.url.startswith("git+ssh://"):
# We are only able to handle SSH Git URLs
url, _, ref = link.url[4:].rpartition("@")
url, ref = link.url[4:], ""
if url.count("@") > 1:
url, _, ref = url.rpartition("@")
filename = download_and_zip_git_repo(
url, ref, link.subdirectory_fragment, wheels_folder
)
Expand Down
1 change: 1 addition & 0 deletions src/bentoml/_internal/container/generate.py
Expand Up @@ -233,6 +233,7 @@ def _resolve_package_versions(requirement: str) -> dict[str, str]:
or req.is_url
or req.is_wheel
or not req.name
or not req.specifier
):
continue
for sp in req.specifier:
Expand Down

0 comments on commit 09db40b

Please sign in to comment.