From 3e27131a697d47548fd7b6379fc6eed9b99b3cec Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Tue, 17 Sep 2024 20:01:22 -0700 Subject: [PATCH] Don't import `pkg_resources` until you need it --- llama_stack/cli/stack/configure.py | 4 ++-- llama_stack/cli/stack/run.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/llama_stack/cli/stack/configure.py b/llama_stack/cli/stack/configure.py index d739aad50..c184a1db5 100644 --- a/llama_stack/cli/stack/configure.py +++ b/llama_stack/cli/stack/configure.py @@ -8,8 +8,6 @@ import argparse import json from pathlib import Path -import pkg_resources - import yaml from termcolor import cprint @@ -49,6 +47,8 @@ class StackConfigure(Subcommand): ) def _run_stack_configure_cmd(self, args: argparse.Namespace) -> None: + import pkg_resources + from llama_stack.distribution.build import ImageType docker_image = None diff --git a/llama_stack/cli/stack/run.py b/llama_stack/cli/stack/run.py index acdbcf3bc..29fec608e 100644 --- a/llama_stack/cli/stack/run.py +++ b/llama_stack/cli/stack/run.py @@ -8,7 +8,6 @@ import argparse from pathlib import Path -import pkg_resources import yaml from llama_stack.cli.subcommand import Subcommand @@ -47,6 +46,8 @@ class StackRun(Subcommand): ) def _run_stack_run_cmd(self, args: argparse.Namespace) -> None: + import pkg_resources + from llama_stack.distribution.utils.exec import run_with_pty if not args.config: