mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-27 18:50:41 +00:00
chore: more mypy fixes (#2029)
# What does this PR do? Mainly tried to cover the entire llama_stack/apis directory, we only have one left. Some excludes were just noop. Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
feb9eb8b0d
commit
1a529705da
27 changed files with 581 additions and 166 deletions
|
@ -38,7 +38,10 @@ class LlamaCLIParser:
|
|||
print_subcommand_description(self.parser, subparsers)
|
||||
|
||||
def parse_args(self) -> argparse.Namespace:
|
||||
return self.parser.parse_args()
|
||||
args = self.parser.parse_args()
|
||||
if not isinstance(args, argparse.Namespace):
|
||||
raise TypeError(f"Expected argparse.Namespace, got {type(args)}")
|
||||
return args
|
||||
|
||||
def run(self, args: argparse.Namespace) -> None:
|
||||
args.func(args)
|
||||
|
|
|
@ -46,7 +46,7 @@ class StackListProviders(Subcommand):
|
|||
else:
|
||||
providers = [(k.value, prov) for k, prov in all_providers.items()]
|
||||
|
||||
providers = [p for api, p in providers if api in self.providable_apis]
|
||||
providers = [(api, p) for api, p in providers if api in self.providable_apis]
|
||||
|
||||
# eventually, this should query a registry at llama.meta.com/llamastack/distributions
|
||||
headers = [
|
||||
|
@ -57,7 +57,7 @@ class StackListProviders(Subcommand):
|
|||
|
||||
rows = []
|
||||
|
||||
specs = [spec for p in providers for spec in p.values()]
|
||||
specs = [spec for api, p in providers for spec in p.values()]
|
||||
for spec in specs:
|
||||
if spec.is_sample:
|
||||
continue
|
||||
|
@ -65,7 +65,7 @@ class StackListProviders(Subcommand):
|
|||
[
|
||||
spec.api.value,
|
||||
spec.provider_type,
|
||||
",".join(spec.pip_packages),
|
||||
",".join(spec.pip_packages) if hasattr(spec, "pip_packages") else "",
|
||||
]
|
||||
)
|
||||
print_table(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue