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
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,33 @@ jobs:

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

- name: Upload coverage data
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
include-hidden-files: true
name: coverage-data-${{ matrix.os }}-py${{ matrix.python-version }}
path: ".coverage.*"

coverage:
name: Coverage
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Download coverage data
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
pattern: coverage-data-*
merge-multiple: true

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0

- name: Install uv
uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0

- name: Combine coverage data and generate report
run: uvx --with tox-uv tox -e coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ dist/
.vscode
.python-version
.tox/
coverage.xml
41 changes: 39 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ dev = [
"types-requests>=2.27.20",
]
tests = [
"coverage>=7.2.7",
"pytest>=7.1.2",
"pytest-asyncio>=0.18.3",
"pytest-cov>=3.0.0",
"requests>=2.26.0",
"responses>=0.20.0",
]
Expand Down Expand Up @@ -75,13 +75,50 @@ env_list = [
[tool.tox.env_run_base]
description = "run unit tests"
dependency_groups = [ "tests" ]
commands = [ [ "pytest", { replace = "posargs", default = [ "tests" ], extend = true } ] ]
commands = [ [ "coverage", "run", "-m", "pytest", { replace = "posargs", default = [ "tests" ], extend = true } ] ]

[tool.tox.env.coverage]
description = "generate coverage report"
depends = [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
]
dependency_groups = [ "tests" ]
commands = [
[ "coverage", "combine" ],
[ "coverage", "report" ],
[ "coverage", "xml" ],
]

[tool.pytest.ini_options]
filterwarnings = [
"error",
]

[tool.coverage.paths]
package = [
"backoff/",
"*/site-packages/backoff/",
]

[tool.coverage.report]
fail_under = 100
show_missing = true

[tool.coverage.run]
branch = true
parallel = true
relative_files = true
source = [
"backoff",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
81 changes: 8 additions & 73 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading