Skip to content

Commit

Permalink
Run ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
hasier committed Mar 18, 2024
1 parent d0f11cb commit 3c5f788
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
16 changes: 12 additions & 4 deletions tenacity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,20 @@ def retry(
stop: "StopBaseT" = stop_never,
wait: "WaitBaseT" = wait_none(),
retry: "t.Union[RetryBaseT, tasyncio.retry.RetryBaseT]" = retry_if_exception_type(),
before: t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]] = before_nothing,
after: t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]] = after_nothing,
before_sleep: t.Optional[t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]]] = None,
before: t.Callable[
["RetryCallState"], t.Union[None, t.Awaitable[None]]
] = before_nothing,
after: t.Callable[
["RetryCallState"], t.Union[None, t.Awaitable[None]]
] = after_nothing,
before_sleep: t.Optional[
t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]]
] = None,
reraise: bool = False,
retry_error_cls: t.Type["RetryError"] = RetryError,
retry_error_callback: t.Optional[t.Callable[["RetryCallState"], t.Union[t.Any, t.Awaitable[t.Any]]]] = None,
retry_error_callback: t.Optional[
t.Callable[["RetryCallState"], t.Union[t.Any, t.Awaitable[t.Any]]]
] = None,
) -> t.Callable[[WrappedFn], WrappedFn]: ...


Expand Down
21 changes: 15 additions & 6 deletions tenacity/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from tenacity import DoSleep
from tenacity import RetryCallState
from tenacity import RetryError
from tenacity import _utils
from tenacity import after_nothing
from tenacity import before_nothing
from tenacity import _utils
Expand Down Expand Up @@ -57,16 +56,26 @@ def asyncio_sleep(duration: float) -> t.Awaitable[None]:
class AsyncRetrying(BaseRetrying):
def __init__(
self,
sleep: t.Callable[[t.Union[int, float]], t.Union[None, t.Awaitable[None]]] = asyncio_sleep,
sleep: t.Callable[
[t.Union[int, float]], t.Union[None, t.Awaitable[None]]
] = asyncio_sleep,
stop: "StopBaseT" = tenacity.stop.stop_never,
wait: "WaitBaseT" = tenacity.wait.wait_none(),
retry: "t.Union[SyncRetryBaseT, RetryBaseT]" = tenacity.retry_if_exception_type(),
before: t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]] = before_nothing,
after: t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]] = after_nothing,
before_sleep: t.Optional[t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]]] = None,
before: t.Callable[
["RetryCallState"], t.Union[None, t.Awaitable[None]]
] = before_nothing,
after: t.Callable[
["RetryCallState"], t.Union[None, t.Awaitable[None]]
] = after_nothing,
before_sleep: t.Optional[
t.Callable[["RetryCallState"], t.Union[None, t.Awaitable[None]]]
] = None,
reraise: bool = False,
retry_error_cls: t.Type["RetryError"] = RetryError,
retry_error_callback: t.Optional[t.Callable[["RetryCallState"], t.Union[t.Any, t.Awaitable[t.Any]]]] = None,
retry_error_callback: t.Optional[
t.Callable[["RetryCallState"], t.Union[t.Any, t.Awaitable[t.Any]]]
] = None,
) -> None:
super().__init__(
sleep=sleep, # type: ignore[arg-type]
Expand Down

0 comments on commit 3c5f788

Please sign in to comment.