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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0

- name: Run tests
run: uvx --with tox-uv tox -e ${{ matrix.python-version }}
run: uvx --with tox-gh --with tox-uv tox

- name: Upload coverage data
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand Down
31 changes: 0 additions & 31 deletions Makefile

This file was deleted.

68 changes: 59 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,25 @@ Repository = "https://github.com/python-backoff/backoff"

[dependency-groups]
dev = [
{ include-group = "tests" },
"flake8>=4.0.1",
"mypy>=0.942",
"types-requests>=2.27.20",
{ include-group = "lint" },
{ include-group = "test" },
{ include-group = "typing" },
]
lint = [
"ruff>=0.12.9",
]
tests = [
test = [
"coverage>=7.2.7",
"pytest>=7.1.2",
"pytest-asyncio>=0.18.3",
"requests>=2.26.0",
"responses>=0.20.0",
]
typing = [
{ include-group = "test" },
"mypy>=0.942",
"types-requests>=2.27.20",
]

[tool.hatch.build.targets.sdist]
include = ["backoff"]
Expand All @@ -60,8 +67,9 @@ include = ["backoff"]

[tool.tox]
min_version = "4.22"
requires = [ "tox", "tox-uv" ]
requires = [ "tox", "tox-gh", "tox-uv" ]
env_list = [
"format",
"3.7",
"3.8",
"3.9",
Expand All @@ -70,12 +78,16 @@ env_list = [
"3.12",
"3.13",
"3.14",
"lint",
"typing",
]

[tool.tox.env_run_base]
description = "run unit tests"
dependency_groups = [ "tests" ]
commands = [ [ "coverage", "run", "-m", "pytest", { replace = "posargs", default = [ "tests" ], extend = true } ] ]
dependency_groups = [ "test" ]
commands = [
[ "coverage", "run", "-m", "pytest", { replace = "posargs", default = [ "tests" ], extend = true } ],
]

[tool.tox.env.coverage]
description = "generate coverage report"
Expand All @@ -89,13 +101,51 @@ depends = [
"3.13",
"3.14",
]
dependency_groups = [ "tests" ]
dependency_groups = [ "test" ]
commands = [
[ "coverage", "combine" ],
[ "coverage", "report" ],
[ "coverage", "xml" ],
]

[tool.tox.env.format]
description = "format code"
dependency_groups = [ "lint" ]
commands = [
[ "ruff", "check", "--fix", { replace = "posargs", default = [ "backoff", "tests" ], extend = true } ],
]

[tool.tox.env.lint]
description = "lint code"
dependency_groups = [ "lint" ]
commands = [
[ "ruff", "check", { replace = "posargs", default = [ "backoff", "tests" ], extend = true } ],
]

[tool.tox.env.typing]
description = "run type checking"
dependency_groups = [ "typing" ]
commands = [
[
"mypy",
"--show-error-codes",
{ replace = "posargs", default = [
"backoff",
"tests",
], extend = true },
],
]

[tool.tox.gh.python]
"3.14" = ["3.14", "lint", "typing"]
"3.13" = ["3.13"]
"3.12" = ["3.12"]
"3.11" = ["3.11"]
"3.10" = ["3.10"]
"3.9" = ["3.9"]
"3.8" = ["3.8"]
"3.7" = ["3.7"]

[tool.pytest.ini_options]
filterwarnings = [
"error",
Expand Down
6 changes: 3 additions & 3 deletions tests/test_backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ def __init__(self):
loggers = [Logger() for _ in range(3)]

@backoff.on_predicate(backoff.constant,
on_backoff=(l.backoffs.append for l in loggers),
on_giveup=(l.giveups.append for l in loggers),
on_success=(l.successes.append for l in loggers),
on_backoff=(l.backoffs.append for l in loggers), # noqa: E741
on_giveup=(l.giveups.append for l in loggers), # noqa: E741
on_success=(l.successes.append for l in loggers), # noqa: E741
max_tries=3,
jitter=None,
interval=0)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from backoff.types import Details


assert Details
assert Details # type: ignore[truthy-function]
Loading
Loading