-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtox.ini
87 lines (75 loc) · 2.33 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
isolated_build = True
envlist =
py{38,39,310,311}-dj32-drf312
py{38,39,310,311,312}-dj{32,40,41}-drf{313,314,315}
py{38,39,310,311,312,313}-dj42-drf{314,315}
py{310,311,312,313}-dj50-drf{314,315}
py{310,311,312,313}-dj51-drf315
lint
docs
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312, lint, docs
3.13: py313
[testenv]
deps =
pytest
pytest-django
drf-spectacular>=0.27.0
django-filter
dj32: Django>=3.2,<4.0
dj40: Django>=4.0,<4.1
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<5.0
dj50: Django>=5.0,<5.1
dj51: Django>=5.1,<5.2
drf312: djangorestframework>=3.12,<3.13
drf313: djangorestframework>=3.13,<3.14
drf314: djangorestframework>=3.14,<3.15
drf315: djangorestframework>=3.15,<3.16
commands =
pytest
[testenv:lint]
skip_install = true
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
[testenv:docs]
extras = doc
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
[pytest]
DJANGO_SETTINGS_MODULE = tests.settings
testpaths = tests
pythonpath = . drf_standardized_errors
[coverage:run]
branch = True
source = drf_standardized_errors
[coverage:report]
omit =
# the hook code is a copy from drf-spectacular with one change
# to exclude error components from being processed by the hook
drf_standardized_errors/openapi_hooks.py
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
# Don't complain about abstract methods, they aren't run:
@(abc\.)?abstractmethod
ignore_errors = True