Skip to content

Commit

Permalink
Ruff 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Nov 22, 2024
1 parent 4659c3d commit 5930212
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.8.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
4 changes: 2 additions & 2 deletions src/stamina/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"Attempt",
"BoundAsyncRetryingCaller",
"BoundRetryingCaller",
"RetryingCaller",
"instrumentation",
"is_active",
"is_testing",
"retry_context",
"retry",
"RetryingCaller",
"retry_context",
"set_active",
"set_testing",
]
Expand Down
4 changes: 2 additions & 2 deletions src/stamina/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class _Config:
"""

__slots__ = (
"lock",
"_get_on_retry",
"_is_active",
"_on_retry",
"_get_on_retry",
"_testing",
"lock",
)

lock: Lock
Expand Down
20 changes: 9 additions & 11 deletions src/stamina/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Attempt:
.. versionadded:: 23.2.0
"""

__slots__ = ("_t_attempt", "_next_wait_fn")
__slots__ = ("_next_wait_fn", "_t_attempt")

_t_attempt: _t.AttemptManager

Expand Down Expand Up @@ -398,16 +398,16 @@ def __aiter__(self) -> _t.AsyncRetrying:
@dataclass
class _RetryContextIterator:
__slots__ = (
"_t_kw",
"_t_a_retrying",
"_name",
"_args",
"_kw",
"_attempts",
"_wait_jitter",
"_kw",
"_name",
"_t_a_retrying",
"_t_kw",
"_wait_exp_base",
"_wait_initial",
"_wait_jitter",
"_wait_max",
"_wait_exp_base",
)
_t_kw: dict[str, object]
_t_a_retrying: _t.AsyncRetrying
Expand Down Expand Up @@ -436,10 +436,8 @@ def from_params(
kw: dict[str, object],
) -> _RetryContextIterator:
if (
isinstance(on, type)
and issubclass(on, BaseException)
or isinstance(on, tuple)
):
isinstance(on, type) and issubclass(on, BaseException)
) or isinstance(on, tuple):
_retry = _t.retry_if_exception_type(on)
else:
_retry = _t.retry_if_exception(on)
Expand Down
6 changes: 3 additions & 3 deletions src/stamina/instrumentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@


__all__ = [
"get_on_retry_hooks",
"set_on_retry_hooks",
"get_prometheus_counter",
"LoggingOnRetryHook",
"PrometheusOnRetryHook",
"RetryDetails",
"RetryHook",
"RetryHookFactory",
"StructlogOnRetryHook",
"get_on_retry_hooks",
"get_prometheus_counter",
"set_on_retry_hooks",
]
4 changes: 2 additions & 2 deletions src/stamina/instrumentation/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ class RetryDetails:
"""

__slots__ = (
"name",
"args",
"caused_by",
"kwargs",
"name",
"retry_num",
"wait_for",
"waited_so_far",
"caused_by",
)

name: str
Expand Down
2 changes: 1 addition & 1 deletion src/stamina/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
from .instrumentation import RetryDetails, RetryHook


__all__ = ["RetryHook", "RetryDetails"]
__all__ = ["RetryDetails", "RetryHook"]

0 comments on commit 5930212

Please sign in to comment.