Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Changed

- Python 3.9+ is required [#152](https://github.com/python-backoff/backoff/pull/152)

### Documentation

- Fixed some examples [#116](https://github.com/python-backoff/backoff/pull/116) (from [@edgarrmondragon](https://github.com/edgarrmondragon))
Expand Down
4 changes: 3 additions & 1 deletion backoff/_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import inspect
import logging
import operator
from typing import TYPE_CHECKING, Any, Callable, Iterable
from typing import TYPE_CHECKING, Any, Callable

from backoff import _async, _sync
from backoff._common import (
Expand All @@ -15,6 +15,8 @@
from backoff._jitter import full_jitter

if TYPE_CHECKING:
from collections.abc import Iterable

from backoff._typing import (
_CallableT,
_Handler,
Expand Down
4 changes: 1 addition & 3 deletions backoff/_typing.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from __future__ import annotations

import logging
from collections.abc import Coroutine, Generator, Sequence
from typing import (
TYPE_CHECKING,
Any,
Callable,
Coroutine,
Generator,
Sequence,
TypedDict,
TypeVar,
Union,
Expand Down
5 changes: 4 additions & 1 deletion backoff/_wait_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import itertools
import math
from typing import Any, Callable, Generator, Iterable
from typing import TYPE_CHECKING, Any, Callable

if TYPE_CHECKING:
from collections.abc import Generator, Iterable


def expo(
Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "2.3.1"
description = "Function decoration for backoff and retry"
authors = [{ name = "Bob Green", email = "rgreen@aquent.com" }]
maintainers = [{ name = "Edgar Ramírez-Mondragón", email = "edgarrm358@gmail.com" }]
requires-python = ">=3.8"
requires-python = ">=3.9"
readme = "README.rst"
license = "MIT"
keywords = [
Expand All @@ -19,7 +19,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -73,12 +72,11 @@ include = ["backoff", "tests"]
include = ["backoff"]

[tool.tox]
min_version = "4.43"
requires = [ "tox>=4.43", "tox-uv" ]
requires = [ "tox>=4.53", "tox-uv" ]
env_list = [
"format",
{ product = [
{ prefix = "3.", start = 8 },
{ prefix = "3.", start = 9 },
] },
"coverage",
"lint",
Expand All @@ -87,7 +85,7 @@ env_list = [
]

[tool.tox.env_run_base]
description = "run unit tests"
description = "run unit tests on Python {py_dot_ver}"
dependency_groups = [ "test" ]
uv_python_preference = "managed"
commands = [
Expand Down
9 changes: 6 additions & 3 deletions tests/test_backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,9 +928,12 @@ def test_event_log_levels(
max_tries = 3
func = func_factory(backoff_log_level, giveup_log_level, max_tries)

with unittest.mock.patch("time.sleep", return_value=None), caplog.at_level(
min(backoff_log_level, giveup_log_level),
logger="backoff",
with (
unittest.mock.patch("time.sleep", return_value=None),
caplog.at_level(
min(backoff_log_level, giveup_log_level),
logger="backoff",
),
):
func()

Expand Down
Loading