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 ) 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: