From 75abda61d151d851dde7e5ce444f5ccee14c745e Mon Sep 17 00:00:00 2001 From: kdziedzic68 Date: Thu, 5 Dec 2024 11:42:15 +0100 Subject: [PATCH] typing --- packages/ragbits-cli/src/ragbits/cli/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ragbits-cli/src/ragbits/cli/__init__.py b/packages/ragbits-cli/src/ragbits/cli/__init__.py index 9fc5d4a9..03ab43ca 100644 --- a/packages/ragbits-cli/src/ragbits/cli/__init__.py +++ b/packages/ragbits-cli/src/ragbits/cli/__init__.py @@ -1,6 +1,7 @@ import importlib.util import pkgutil from pathlib import Path +from typing import Annotated import typer @@ -13,8 +14,12 @@ @app.callback() def output_type( - output: OutputType = typer.Option("text", "--output", "-o", help="Set the output type (text or json)"), # noqa: B008 + output: Annotated[ + OutputType, typer.Option("--output", "-o", help="Set the output type (text or json)") + ] = OutputType.text.value, # type: ignore ) -> None: + # type ignore is a workaround for typer issue + # enforcing to use str as default value """Sets an output type for the CLI Args: output: type of output to be set