chore: bump ruff target-version to 3.10

This commit is contained in:
Meng Xiangzhuo
2024-11-08 04:37:33 +08:00
parent 44ff6d50ec
commit 41b725714f
122 changed files with 920 additions and 995 deletions

View File

@@ -1,4 +1,4 @@
from typing import Callable, Optional, Union
from collections.abc import Callable
from rich.console import ConsoleRenderable, Group, RichCast
from rich.progress import Progress
@@ -8,8 +8,8 @@ class CustomProgress(Progress):
def __init__(
self,
*args,
cust_objs: Optional[list[ConsoleRenderable]] = None,
cust_callables: Optional[list[Callable[[], ConsoleRenderable]]] = None,
cust_objs: list[ConsoleRenderable] | None = None,
cust_callables: list[Callable[[], ConsoleRenderable]] | None = None,
**kwargs,
) -> None:
self._cust_objs = cust_objs or []
@@ -17,7 +17,7 @@ class CustomProgress(Progress):
super().__init__(*args, **kwargs)
def get_renderable(self) -> Union[ConsoleRenderable, RichCast, str]:
def get_renderable(self) -> ConsoleRenderable | RichCast | str:
objs = [obj for obj in self._cust_objs]
for cust_call in self._cust_callables:
objs.append(cust_call())