From 7af56ed7c8811c88c870198cb1fce01facac4dd5 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Sat, 1 Mar 2025 20:51:22 -0600 Subject: [PATCH 1/2] Fix tox coverage config Run coverage after py3.13 tests, and combine+report in separate steps to get simpler reporting semantics when using `tox p`. --- .github/workflows/build.yaml | 2 +- tox.ini | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cf630c3e3..63dc30e04 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -98,7 +98,7 @@ jobs: - name: test run: | python -m tox run -m ci -- --junitxml pytest.{envname}.xml - python -m tox run -e cov + python -m tox run -e cov_combine,cov_report - uses: actions/upload-artifact@v4 with: diff --git a/tox.ini b/tox.ini index 6edec916f..115d46171 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,8 @@ envlist = py{313,312,311,310,39} py{39,313}-{json5,pyjson5}{,-format} py{39,313}-{disable_orjson} - cov + cov_combine + cov_report skip_missing_interpreters = true minversion = 4.0.0 @@ -39,13 +40,19 @@ skip_install = true commands = coverage erase depends = -[testenv:cov] -description = "combine and report coverage data" +[testenv:cov_combine] +description = "combine coverage data" +deps = coverage +skip_install = true +commands = coverage combine +depends = py{,38,39,310,311,312,313}{,-mindeps,-format,-json5,-pyjson5,-disable_orjson} + +[testenv:cov_report] +description = "report test coverage" deps = coverage skip_install = true -commands_pre = - coverage combine commands = coverage report --skip-covered -depends = py{,38,39,310,311,312}{,-mindeps,-format,-json5,-pyjson5,-disable_orjson} +depends = cov_combine [testenv:mypy] description = "check type annotations with mypy" From 6f55876f6894c01dd18dc01e433d1091bd1397cf Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Sat, 1 Mar 2025 21:50:09 -0600 Subject: [PATCH 2/2] Improve CI job names --- .github/workflows/build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 63dc30e04..0f14f3c1e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ jobs: py: "3.9" runs-on: ubuntu-latest - name: "Run '${{ matrix.toxenv }}' on python ${{ matrix.py }}" + name: "'${{ matrix.toxenv }}' on py${{ matrix.py }}" steps: - uses: actions/checkout@v4 @@ -61,10 +61,10 @@ jobs: ci-test-matrix: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu, windows, macos] py: ['3.9', '3.10', '3.11', '3.12', '3.13'] - name: "Run tests on ${{ matrix.os }}, py${{ matrix.py }}" - runs-on: ${{ matrix.os }} + name: "Test on ${{ matrix.os }}, py${{ matrix.py }}" + runs-on: "${{ matrix.os }}-latest" steps: - uses: actions/checkout@v4