-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
81 lines (75 loc) · 1.76 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
[tox]
isolated_build = true
skip_missing_interpreters = true
parallel_show_output = true
envlist =
py{310,311,312}-dj{42,51}
[pytest]
testpaths = test
django_find_project = true
filterwarnings =
error
DJANGO_SETTINGS_MODULE=demo_proj.settings
addopts =
--tb=short
[testenv]
skip_install = true
description = Run tests in {envname} environment
setenv =
PYTHONHASHSEED=0
PYTHONPATH={toxinidir}:demo
PYTHONBREAKPOINT=ipdb.set_trace
commands =
pip install -e .
pytest {posargs}
deps =
pytest
pytest-django
dj42: Django>=4.2.0,<5.0
dj51: Django>=5.1,<5.2
[testenv:pep8]
description = Run flake8 against the source code
skipsdist = true
skip_install = true
basepython = python3.12
deps = flake8
commands = flake8 src/travel test demo
[testenv:clean]
description=Removes all the cache files
skipdist = true
skip_install = true
deps =
whitelist_externals =
find
rm
commands =
rm -rf \
{toxinidir}/build \
{toxinidir}/.cache \
{toxinidir}/.coverage \
{toxinidir}/pip-wheel-metadata \
{toxinidir}/.pytest_cache \
{toxinidir}/.tox \
{toxinidir}/demo/demo_proj/db.sqlite3 \
{toxinidir}/htmlcov \
{toxinidir}/src/django_travel.egg-info
find {toxinidir} -type f -name "*.pyc" -delete
find {toxinidir} -type d -name "__pycache__" -delete
[testenv:coverage]
description = Run test coverage and display results
basepython = python3.12
deps =
{[testenv]deps}
coverage
pytest-cov
whitelist_externals =
echo
commands =
pip install -e .
pytest --cov-config .coveragerc --cov-report html --cov-report term --cov=travel
echo HTML coverage report: {toxinidir}/htmlcov/index.html
[gh-actions]
python =
3.10: py310
3.11: py311
3.12: py312