Skip to content

Commit 5930212

Browse files
committed
Ruff 0.8.0
1 parent 4659c3d commit 5930212

File tree

7 files changed

+20
-22
lines changed

7 files changed

+20
-22
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.7.2
7+
rev: v0.8.0
88
hooks:
99
- id: ruff
1010
args: [--fix, --exit-non-zero-on-fix]

src/stamina/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"Attempt",
2121
"BoundAsyncRetryingCaller",
2222
"BoundRetryingCaller",
23+
"RetryingCaller",
2324
"instrumentation",
2425
"is_active",
2526
"is_testing",
26-
"retry_context",
2727
"retry",
28-
"RetryingCaller",
28+
"retry_context",
2929
"set_active",
3030
"set_testing",
3131
]

src/stamina/_config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ class _Config:
5252
"""
5353

5454
__slots__ = (
55-
"lock",
55+
"_get_on_retry",
5656
"_is_active",
5757
"_on_retry",
58-
"_get_on_retry",
5958
"_testing",
59+
"lock",
6060
)
6161

6262
lock: Lock

src/stamina/_core.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Attempt:
109109
.. versionadded:: 23.2.0
110110
"""
111111

112-
__slots__ = ("_t_attempt", "_next_wait_fn")
112+
__slots__ = ("_next_wait_fn", "_t_attempt")
113113

114114
_t_attempt: _t.AttemptManager
115115

@@ -398,16 +398,16 @@ def __aiter__(self) -> _t.AsyncRetrying:
398398
@dataclass
399399
class _RetryContextIterator:
400400
__slots__ = (
401-
"_t_kw",
402-
"_t_a_retrying",
403-
"_name",
404401
"_args",
405-
"_kw",
406402
"_attempts",
407-
"_wait_jitter",
403+
"_kw",
404+
"_name",
405+
"_t_a_retrying",
406+
"_t_kw",
407+
"_wait_exp_base",
408408
"_wait_initial",
409+
"_wait_jitter",
409410
"_wait_max",
410-
"_wait_exp_base",
411411
)
412412
_t_kw: dict[str, object]
413413
_t_a_retrying: _t.AsyncRetrying
@@ -436,10 +436,8 @@ def from_params(
436436
kw: dict[str, object],
437437
) -> _RetryContextIterator:
438438
if (
439-
isinstance(on, type)
440-
and issubclass(on, BaseException)
441-
or isinstance(on, tuple)
442-
):
439+
isinstance(on, type) and issubclass(on, BaseException)
440+
) or isinstance(on, tuple):
443441
_retry = _t.retry_if_exception_type(on)
444442
else:
445443
_retry = _t.retry_if_exception(on)

src/stamina/instrumentation/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313

1414
__all__ = [
15-
"get_on_retry_hooks",
16-
"set_on_retry_hooks",
17-
"get_prometheus_counter",
1815
"LoggingOnRetryHook",
1916
"PrometheusOnRetryHook",
2017
"RetryDetails",
2118
"RetryHook",
2219
"RetryHookFactory",
2320
"StructlogOnRetryHook",
21+
"get_on_retry_hooks",
22+
"get_prometheus_counter",
23+
"set_on_retry_hooks",
2424
]

src/stamina/instrumentation/_data.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ class RetryDetails:
4646
"""
4747

4848
__slots__ = (
49-
"name",
5049
"args",
50+
"caused_by",
5151
"kwargs",
52+
"name",
5253
"retry_num",
5354
"wait_for",
5455
"waited_so_far",
55-
"caused_by",
5656
)
5757

5858
name: str

src/stamina/typing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
from .instrumentation import RetryDetails, RetryHook
88

99

10-
__all__ = ["RetryHook", "RetryDetails"]
10+
__all__ = ["RetryDetails", "RetryHook"]

0 commit comments

Comments
 (0)