-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.ini
71 lines (64 loc) · 1.83 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
# Tox Configuration
[tox]
min_version = 4.0.0
env_list = {py38,py39,py310}-django32,
{py39,py310,py311}-{django41,django42},
format, lint, coverage
labels =
test = python{37, 38, 39, 310, 311}, coverage
static = format, lint
[testenv]
description = Run tests with pytest.
deps =
django32: django~=3.2.0
django41: Django>=4.1,<4.2
django42: Django>=4.2,<5.0
pytest-django
pytest-sugar
commands = pytest {posargs}
[testenv:coverage]
description = Generate test coverage report with pytest-cov.
deps =
pytest-django
pytest-cov
pytest-sugar
commands =
pytest --cov=document_catalogue {posargs}
[testenv:format]
description = Check source code format with black and isort.
skip_install = true
deps =
black
isort
commands =
black --check --diff document_catalogue demo tests {posargs}
isort --check --diff document_catalogue demo tests {posargs}
[testenv:lint]
description = Lint source code with flake8.
skip_install = true
deps =
flake8
flake8-bugbear
commands =
flake8 . {posargs}
# Other Configuration
[pytest]
DJANGO_SETTINGS_MODULE = tests.settings.private
# -- recommended but optional:
python_files = tests.py test_*.py *_tests.py
[flake8]
# Flake8 Error Code References:
# F###, E999, C90#: https://flake8.pycqa.org/en/latest/user/error-codes.html
# E###, W###: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
# B950: leave max line length to black
# F40*: settings use "from parent import *" to implement setting inheritance - its ok
# B02*: false positives for perfectly reasonable use of ABC
select = C,E,F,W,B,B950
extend-ignore = E203,E501,B950
per-file-ignores =
tasks/__init__.py: F401
*/settings/*.py: F401,F403,F405
document_catalogue/plugins.py: B024,B027
extend-exclude = docs,dist,venv
max-line-length = 88
max-complexity = 10