Change venv

This commit is contained in:
Ambulance Clerc
2023-05-31 08:31:22 +02:00
parent fb6f579089
commit fdbb52c96f
466 changed files with 25899 additions and 64721 deletions

View File

@@ -16,6 +16,8 @@
import abc
import typing
from pip._vendor.tenacity import _utils
if typing.TYPE_CHECKING:
import threading
@@ -36,6 +38,9 @@ class stop_base(abc.ABC):
return stop_any(self, other)
StopBaseT = typing.Union[stop_base, typing.Callable[["RetryCallState"], bool]]
class stop_any(stop_base):
"""Stop if any of the stop condition is valid."""
@@ -89,8 +94,10 @@ class stop_after_attempt(stop_base):
class stop_after_delay(stop_base):
"""Stop when the time from the first attempt >= limit."""
def __init__(self, max_delay: float) -> None:
self.max_delay = max_delay
def __init__(self, max_delay: _utils.time_unit_type) -> None:
self.max_delay = _utils.to_seconds(max_delay)
def __call__(self, retry_state: "RetryCallState") -> bool:
if retry_state.seconds_since_start is None:
raise RuntimeError("__call__() called but seconds_since_start is not set")
return retry_state.seconds_since_start >= self.max_delay