From 497c31313de9e771bddf6162fbf4b27e656b6f51 Mon Sep 17 00:00:00 2001 From: fstagni Date: Tue, 5 Sep 2023 17:37:40 +0200 Subject: [PATCH] fix: fix 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..1d050fb4 100644 --- a/src/diracx/cli/__init__.py +++ b/src/diracx/cli/__init__.py @@ -1,9 +1,12 @@ +# ruff: noqa: UP007 # because of https://github.com/tiangolo/typer/issues/533 + from __future__ import annotations import asyncio import json import os from datetime import datetime, timedelta, timezone +from typing import Optional from typer import Option @@ -21,8 +24,8 @@ @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, + property: Optional[list[str]] = Option(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): if "DIRACX_OUTPUT_FORMAT" not in os.environ: output_format = output_format or "rich" if output_format is not None: