From b2fecde58f68a23cd83210f620a475dbc0446a04 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Wed, 8 May 2024 13:07:10 +0800 Subject: [PATCH 1/2] fix: handle ssh git url without ref part Signed-off-by: Frost Ming --- src/bentoml/_internal/bento/build_config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bentoml/_internal/bento/build_config.py b/src/bentoml/_internal/bento/build_config.py index f5487c3b1a6..6a55827e91c 100644 --- a/src/bentoml/_internal/bento/build_config.py +++ b/src/bentoml/_internal/bento/build_config.py @@ -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 ) From e489183bfbd18965829eda546a16d19563ed65a1 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Wed, 8 May 2024 13:17:20 +0800 Subject: [PATCH 2/2] fix: handle empty specifier Signed-off-by: Frost Ming --- src/bentoml/_internal/container/generate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bentoml/_internal/container/generate.py b/src/bentoml/_internal/container/generate.py index 839fcff2569..8713443ae5f 100644 --- a/src/bentoml/_internal/container/generate.py +++ b/src/bentoml/_internal/container/generate.py @@ -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: