diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f880b8d..b80de7d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -76,11 +76,11 @@ You will find the built documentation in `docs/_build/html`. """ Do something. - Parameters: - x: A very important parameter. + Args: + x: A very important parameter. Returns: - The result of doing something. + The result of doing something. """ ``` diff --git a/src/stamina/_core.py b/src/stamina/_core.py index 5f061ea..b288a03 100644 --- a/src/stamina/_core.py +++ b/src/stamina/_core.py @@ -325,29 +325,30 @@ def retry( All float-based time parameters are in seconds. - Parameters: - on: An Exception or a tuple of Exceptions on which the decorated + Args: + on: + An Exception or a tuple of Exceptions on which the decorated callable will be retried. There is no default -- you *must* pass this explicitly. - attempts: Maximum total number of attempts. Can be combined with - *timeout*. + attempts: + Maximum total number of attempts. Can be combined with *timeout*. - timeout: Maximum total time for all retries. Can be combined with + timeout: + Maximum total time for all retries. Can be combined with *attempts*. wait_initial: Minimum backoff before the *first* retry. wait_max: Maximum backoff time between retries at any time. - wait_jitter: Maximum *jitter* that is added to retry back-off delays - (the actual jitter added is a random number between 0 and - *wait_jitter*) + wait_jitter: + Maximum *jitter* that is added to retry back-off delays (the actual + jitter added is a random number between 0 and *wait_jitter*) wait_exp_base: The exponential base used to compute the retry backoff. .. versionchanged:: 23.1.0 - All time-related parameters can now be specified as a :class:`datetime.timedelta`. diff --git a/src/stamina/instrumentation/_data.py b/src/stamina/instrumentation/_data.py index fdd24cc..92495b9 100644 --- a/src/stamina/instrumentation/_data.py +++ b/src/stamina/instrumentation/_data.py @@ -30,14 +30,15 @@ class RetryDetails: kwargs: Keyword arguments that were passed to the callable. - retry_num: Number of the retry attempt. Starts at 1 after the first - failure. + retry_num: + Number of the retry attempt. Starts at 1 after the first failure. - wait_for: Time in seconds that *stamina* will wait before the next - attempt. + wait_for: + Time in seconds that *stamina* will wait before the next attempt. - waited_so_far: Time in seconds that *stamina* has waited so far for the - current callable. + waited_so_far: + Time in seconds that *stamina* has waited so far for the current + callable. caused_by: Exception that caused the retry attempt. diff --git a/src/stamina/instrumentation/_hooks.py b/src/stamina/instrumentation/_hooks.py index 3907202..64b0a9b 100644 --- a/src/stamina/instrumentation/_hooks.py +++ b/src/stamina/instrumentation/_hooks.py @@ -58,9 +58,9 @@ def set_on_retry_hooks( Set hooks that are called after a retry has been scheduled. Args: - hooks: Hooks to call after a retry has been scheduled. Passing - None resets to default. To deactivate instrumentation, pass an - empty iterable. + hooks: + Hooks to call after a retry has been scheduled. Passing None resets + to default. To deactivate instrumentation, pass an empty iterable. .. versionadded:: 23.2.0 """