mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
Enforce modern Python typing annotations with Ruff (#8296)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
from concurrent import futures
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from typing import Callable, Coroutine, Iterable, List
|
||||
from typing import Callable, Coroutine, Iterable
|
||||
|
||||
GENERAL_TIMEOUT: int = 15
|
||||
EXECUTOR = ThreadPoolExecutor()
|
||||
@@ -64,7 +64,7 @@ async def call_coro_in_bg_thread(
|
||||
|
||||
async def wait_all(
|
||||
iterable: Iterable[Coroutine], timeout: int = GENERAL_TIMEOUT
|
||||
) -> List:
|
||||
) -> list:
|
||||
"""
|
||||
Shorthand for waiting for all the coroutines in the iterable given in parallel. Creates
|
||||
a task for each coroutine.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import importlib
|
||||
from functools import lru_cache
|
||||
from typing import Type, TypeVar
|
||||
from typing import TypeVar
|
||||
|
||||
T = TypeVar('T')
|
||||
|
||||
@@ -15,7 +15,7 @@ def import_from(qual_name: str):
|
||||
|
||||
|
||||
@lru_cache()
|
||||
def get_impl(cls: Type[T], impl_name: str | None) -> Type[T]:
|
||||
def get_impl(cls: type[T], impl_name: str | None) -> type[T]:
|
||||
"""Import a named implementation of the specified class"""
|
||||
if impl_name is None:
|
||||
return cls
|
||||
|
||||
Reference in New Issue
Block a user