Skip to content

Commit

Permalink
chore: lazy import requirementsfile
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
  • Loading branch information
aarnphm committed Dec 8, 2022
1 parent 7a9ced6 commit b516dab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bentoml/_internal/bento/build_config.py
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b516dab

Please sign in to comment.