From 7a9ced61c6ca77c2435bd432588b4ab2e6e75af8 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:18:33 -0800 Subject: [PATCH 1/2] fix: failing ci Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 77c0036e611..2ff256785e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ dependencies = [ "opentelemetry-instrumentation-asgi==0.35b0", "opentelemetry-semantic-conventions==0.35b0", "opentelemetry-util-http==0.35b0", - "packaging>=20.0", + "packaging>=20.0,<22", "pathspec", "pip-tools>=6.6.2", "pip-requirements-parser>=31.2.0", From b516dab49a124dfe2f7659d640087103b9ef0dc4 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Wed, 7 Dec 2022 20:12:02 -0800 Subject: [PATCH 2/2] chore: lazy import requirementsfile Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com> --- src/bentoml/_internal/bento/build_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bentoml/_internal/bento/build_config.py b/src/bentoml/_internal/bento/build_config.py index 01db304ece3..e057c4b2db4 100644 --- a/src/bentoml/_internal/bento/build_config.py +++ b/src/bentoml/_internal/bento/build_config.py @@ -16,7 +16,6 @@ import psutil import fs.copy from pathspec import PathSpec -from pip_requirements_parser import RequirementsFile from ..utils import bentoml_cattr from ..utils import resolve_user_filepath @@ -598,6 +597,8 @@ def write_to_bento(self, bento_fs: FS, build_ctx: str) -> None: f.write(install_sh) if self.requirements_txt is not None: + from pip_requirements_parser import RequirementsFile + requirements_txt = RequirementsFile.from_file( resolve_user_filepath(self.requirements_txt, build_ctx), include_nested=True,