Skip to content

Commit 4fb9a89

Browse files
Fix coverage reporting (#72)
Fix coverage reporting and migrates tool configs to pyproject.toml.
1 parent 6a61666 commit 4fb9a89

File tree

5 files changed

+42
-37
lines changed

5 files changed

+42
-37
lines changed

.checkignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.coveragerc

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ jobs:
4040
run: python -m pip install --upgrade pip setuptools virtualenv wheel
4141

4242
- name: Install dependencies
43-
run: python -m pip install --upgrade codecov tox tox-py
43+
run: python -m pip install --upgrade coverage[toml] tox tox-py
4444

4545
- name: Run tox targets for ${{ matrix.python-version }}
46-
run: tox --py current
46+
run: |
47+
tox --py current
48+
coverage xml
4749
48-
- name: Upload coverage
49-
run: codecov -e TOXENV,DJANGO
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v3

pyproject.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,41 @@ build-backend = "setuptools.build_meta"
66
target-version = ['py37']
77
skip-string-normalization = true
88

9+
[tool.coverage.run]
10+
branch = true
11+
source = ['django_cryptography']
12+
13+
[tool.coverage.report]
14+
exclude_lines = [
15+
'if self.debug:',
16+
'pragma: no cover',
17+
'raise NotImplementedError',
18+
'if __name__ == .__main__.:',
19+
]
20+
ignore_errors = true
21+
omit = ['docs/*', 'tests/*']
22+
923
[tool.isort]
1024
profile = 'black'
25+
26+
[tool.tox]
27+
# language=ini
28+
legacy_tox_ini = """
29+
[tox]
30+
envlist =
31+
{py37,py38,py39}-django22,
32+
{py37,py38,py39}-django32,
33+
{py38,py39,py310}-django40,
34+
{py38,py39,py310}-djangomain,
35+
isolated_build = True
36+
37+
[testenv]
38+
deps =
39+
coverage[toml]
40+
django22: Django>=2.2,<2.3
41+
django32: Django>=3.2,<3.3
42+
django40: Django>=4.0,<4.1
43+
djangomain: https://github.com/django/django/archive/main.tar.gz
44+
commands =
45+
{envpython} -m coverage run --context='{envname}' runtests.py {posargs}
46+
"""

tox.ini

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)