Skip to content

Commit cefca20

Browse files
Apply the Ruff I rules
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
1 parent eb22994 commit cefca20

17 files changed

Lines changed: 30 additions & 21 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
- Apply the Ruff `RET` rules [#92](https://github.com/python-backoff/backoff/pull/92) (from [@edgarrmondragon](https://github.com/edgarrmondragon))
88

9+
- Apply the Ruff `I` rules [#99](https://github.com/python-backoff/backoff/pull/99) (from [@edgarrmondragon](https://github.com/edgarrmondragon))
10+
911
## [v2.3.1] - 2025-12-18
1012

1113
### Fixed

backoff/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from backoff._decorator import on_exception, on_predicate
1616
from backoff._jitter import full_jitter, random_jitter
17-
from backoff._wait_gen import constant, expo, fibo, runtime, decay
17+
from backoff._wait_gen import constant, decay, expo, fibo, runtime
1818

1919
__all__ = [
2020
"on_predicate",

backoff/_common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import traceback
55
import warnings
66

7-
87
# Use module-specific logger with a default null handler.
98
_logger = logging.getLogger("backoff")
109
_logger.addHandler(logging.NullHandler()) # pragma: no cover

backoff/_decorator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import operator
44
from typing import Any, Callable, Iterable, Optional, Type, Union
55

6+
from backoff import _async, _sync
67
from backoff._common import (
7-
_prepare_logger,
88
_config_handlers,
99
_log_backoff,
1010
_log_giveup,
11+
_prepare_logger,
1112
)
1213
from backoff._jitter import full_jitter
13-
from backoff import _async, _sync
1414
from backoff._typing import (
1515
_CallableT,
1616
_Handler,

docs/examples.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Real-world examples of using backoff in production.
77
### Basic API Retry
88

99
```python
10-
import backoff
1110
import requests
1211

12+
import backoff
13+
1314

1415
@backoff.on_exception(
1516
backoff.expo,
@@ -111,6 +112,7 @@ def execute_transaction(session, operation):
111112

112113
```python
113114
import aiohttp
115+
114116
import backoff
115117

116118

docs/getting-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ Backoff provides two main decorators:
2222
Let's start with a simple example - retrying a network request:
2323

2424
```python
25-
import backoff
2625
import requests
2726

27+
import backoff
28+
2829

2930
@backoff.on_exception(
3031
backoff.expo,

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ pip install python-backoff
2929
Basic retry on exception:
3030

3131
```python
32-
import backoff
3332
import requests
3433

34+
import backoff
35+
3536

3637
@backoff.on_exception(
3738
backoff.expo,

docs/user-guide/async.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Backoff fully supports Python's `async`/`await` syntax for asynchronous code.
77
Simply decorate async functions with the same decorators:
88

99
```python
10-
import backoff
1110
import aiohttp
1211

12+
import backoff
13+
1314

1415
@backoff.on_exception(backoff.expo, aiohttp.ClientError)
1516
async def fetch_data(url):
@@ -142,9 +143,11 @@ async def async_function():
142143

143144
```python
144145
import asyncio
146+
import logging
147+
145148
import aiohttp
149+
146150
import backoff
147-
import logging
148151

149152
logger = logging.getLogger(__name__)
150153

docs/user-guide/decorators.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ The `on_exception` decorator retries a function when a specified exception is ra
99
### Basic Usage
1010

1111
```python
12-
import backoff
1312
import requests
1413

14+
import backoff
15+
1516

1617
@backoff.on_exception(
1718
backoff.expo,

docs/user-guide/event-handlers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ def my_function():
170170
### Structured Logging
171171

172172
```python
173-
import logging
174173
import json
174+
import logging
175175

176176
logger = logging.getLogger(__name__)
177177

0 commit comments

Comments
 (0)