Skip to content

Commit 4537fe7

Browse files
Enable the UP (pyupgrade) Ruff rules and use Python 3.8+ code, including in docs
Signed-off-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>
1 parent d3b8a69 commit 4537fe7

26 files changed

Lines changed: 32 additions & 39 deletions

‎.pre-commit-config.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ repos:
3030
rev: v2025.12.8.5
3131
hooks:
3232
- id: doccmd
33+
name: Ruff format docs
34+
alias: ruff-format-docs
3335
args: ["--language", "python", "--no-pad-file", "--no-pad-groups", "--command", "ruff format", "docs/"]
3436
additional_dependencies:
3537
- ruff==0.14.8
38+
- id: doccmd
39+
name: Ruff check fix docs
40+
alias: ruff-check-fix-docs
41+
args: ["--language", "python", "--no-pad-file", "--no-pad-groups", "--command", "ruff check --fix", "docs/"]
42+
additional_dependencies:
43+
- ruff==0.14.8

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
### Internal
1717

1818
- Use Ruff to give the codebase a consistent format [#66](https://github.com/python-backoff/backoff/pull/66) (from [@edgarrmondragon](https://github.com/edgarrmondragon))
19+
- Enable the `UP` (pyupgrade) Ruff rules and use Python 3.8+ code, including in docs [#73](https://github.com/python-backoff/backoff/pull/73) (from [@edgarrmondragon](https://github.com/edgarrmondragon))
1920

2021
## [v2.3.0] - 2025-11-28
2122

‎README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ asynchronous HTTP client/server library.
374374
max_time=60,
375375
)
376376
async def get_url(url):
377-
async with aiohttp.ClientSession(raise_for_status=True) as session:
377+
async with aiohttp.ClientSession(raise_for_status=True) as session: # noqa: SIM117
378378
async with session.get(url) as response:
379379
return await response.text()
380380

‎backoff/__init__.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding:utf-8
21
"""
32
Function decoration for backoff and retry
43

‎backoff/_async.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding:utf-8
21
import asyncio
32
import functools
43
import inspect

‎backoff/_common.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding:utf-8
21

32
import functools
43
import logging

‎backoff/_decorator.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding:utf-8
21
import inspect
32
import logging
43
import operator

‎backoff/_jitter.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding:utf-8
21

32
import random
43

‎backoff/_sync.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding:utf-8
21
import functools
32
import time
43

‎backoff/_typing.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding:utf-8
21
import logging
32
import sys
43
from types import FunctionType

0 commit comments

Comments
 (0)