Skip to content

Commit

Permalink
fix: fix for fastapi/typer#533
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Sep 5, 2023
1 parent 1092836 commit 497c313
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/diracx/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 497c313

Please sign in to comment.