Skip to content

Commit

Permalink
fix running coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Sep 17, 2024
1 parent 6489893 commit 211c0ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,10 @@ jobs:

- uses: hynek/setup-cached-uv@v2

- name: Prepare tox
run: |
echo TOX_PYTHON=py$(echo ${{ matrix.python-version }} | tr -d .) >>$GITHUB_ENV
- run: >-
uvx --with=tox-uv
tox run
-e ${{ env.TOX_PYTHON }}-coverage
-e py${{ matrix.python-version }}-coverage
env:
COVERAGE_FILE: ".coverage.${{ matrix.os }}.${{ matrix.python-version }}"
# Alternatively you can run coverage with the --parallel flag or add
Expand All @@ -137,6 +133,7 @@ jobs:
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage.${{ matrix.os }}.${{ matrix.python-version }}
if-no-files-found: error

coverage:
name: Coverage
Expand Down
22 changes: 22 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,24 @@ pass_env = SETUPTOOLS_SCM_PRETEND_VERSION
package = wheel
wheel_build_env = .pkg
extras = test
allowlist_externals =
echo
false
# This and the next few testenvs are a workaround for
# https://github.com/tox-dev/tox/issues/2858.
commands =
echo "Unrecognized environment name {envname}"
false


[testenv:tests]
commands = pytest {posargs:-n auto}


[testenv:py3{,.}{8,9,10,11,12}-tests]
commands = {[testenv:tests]commands}


[testenv:mypy]
commands = mypy --install-types --non-interactive {posargs:subliminal tests}

Expand All @@ -34,6 +46,11 @@ set_env =
COVERAGE_PROCESS_START = pyproject.toml
commands = pytest --cov --cov-report=term-missing:skip-covered {posargs:-n auto}


[testenv:py3{,.}{8,9,10,11,12}-coverage]
commands = {[testenv:coverage]commands}


[testenv:coverage-core]
usedevelop = true
deps = coverage[toml]>=7
Expand All @@ -45,6 +62,11 @@ commands =
--omit='subliminal/cli.py,subliminal/converters/*,subliminal/providers/*,subliminal/refiners/*' \
--skip-covered --fail-under=100


[testenv:py3{,.}{8,9,10,11,12}-coverage-core]
commands = {[testenv:coverage-core]commands}


[testenv:pre-commit]
description =
run pre-commit-defined linters under `{basepython}`
Expand Down

0 comments on commit 211c0ef

Please sign in to comment.