From 574e7c8c955dbeeb1f1beab70a7cbd51ef4c6cea Mon Sep 17 00:00:00 2001 From: fstagni Date: Mon, 4 Sep 2023 17:55:45 +0200 Subject: [PATCH] fix: workaround for https://github.com/tiangolo/typer/issues/533 --- src/diracx/cli/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/diracx/cli/__init__.py b/src/diracx/cli/__init__.py index c77a7a1b..abd72074 100644 --- a/src/diracx/cli/__init__.py +++ b/src/diracx/cli/__init__.py @@ -4,6 +4,7 @@ import json import os from datetime import datetime, timedelta, timezone +from typing import Optional from typer import Option @@ -21,8 +22,10 @@ @app.async_command() async def login( vo: str, - group: str | None = None, - property: list[str] | None = Option(None, help="Override the default(s) with one or more properties"), + group: Optional[str] = None, # noqa: UP007 + property: Optional[list[str]] = Option( # noqa: UP007 + None, help="Override the default(s) with one or more properties" + ), ): scopes = [f"vo:{vo}"] if group: @@ -77,7 +80,7 @@ async def logout(): @app.callback() -def callback(output_format: str | None = None): +def callback(output_format: Optional[str] = None): # noqa: UP007 if "DIRACX_OUTPUT_FORMAT" not in os.environ: output_format = output_format or "rich" if output_format is not None: