-
-
Notifications
You must be signed in to change notification settings - Fork 315
/
tox.ini
197 lines (181 loc) · 4.45 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# This file is part of the django-environ.
#
# Copyright (c) 2021-2023, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
# For the full copyright and license information, please view
# the LICENSE.txt file that was distributed with this source code.
# Tox (https://tox.readthedocs.io) - run tests in multiple virtualenvs.
# Also contains configuration settings for all tools executed by Tox.
[tox]
minversion = 3.22
envlist =
build
coverage-report
linkcheck
docs
lint
manifest
py{36,37,38,39,310,311}-django{111,22}
py{36,37,38,39,310,311}-django{30,31,32}
py{38,39,310,311}-django{40,41,42}
pypy-django{111,22,30,31,32}
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
pypy-3.7: pypy
[testenv]
description = Unit tests
extras = testing
deps =
django111: Django>=1.11,<2
django22: Django>=2.2,<3.0
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2,<5.0
commands_pre =
python -m pip install --upgrade pip
python -m pip install .
commands =
coverage erase
coverage run -m pytest {posargs}
[testenv:coverage-report]
description = Combine coverage reports
skip_install = true
deps = coverage[toml]>=5.4
commands =
coverage combine
coverage report
coverage html
coverage xml
[testenv:lint]
description = Static code analysis and code style check
skip_install = true
deps =
flake8
flake8-blind-except
flake8-import-order
pylint
commands_pre =
python -m pip install --upgrade pip
python -m pip install .
commands =
flake8 environ setup.py
pylint \
--logging-format-style=old \
--good-names-rgxs=m[0-9],f,v \
--disable=too-few-public-methods \
--disable=import-error \
--disable=unused-import \
--disable=too-many-locals \
--disable=too-many-branches \
--disable=too-many-public-methods \
--disable=too-many-lines \
environ
[testenv:linkcheck]
description = Check external links in the package documentation
# Keep basepython in sync with .readthedocs.yml and docs.yml
# (GitHub Action Workflow).
basepython = python3.10
extras = docs
commands =
{envpython} -m sphinx \
-j auto \
-b linkcheck \
{tty:--color} \
-n -W -a \
--keep-going \
-d {envtmpdir}/doctrees \
docs \
docs/_build/linkcheck
isolated_build = true
[testenv:docs]
description = Build package documentation (HTML)
# Keep basepython in sync with .readthedocs.yml and docs.yml
# (GitHub Action Workflow).
basepython = python3.10
extras = docs
commands =
{envpython} -m sphinx \
-j auto \
-b html \
{tty:--color} \
-n -T -W \
-d {envtmpdir}/doctrees \
docs \
docs/_build/html
{envpython} -m sphinx \
-j auto \
-b doctest \
{tty:--color} \
-n -T -W \
-d {envtmpdir}/doctrees \
docs \
docs/_build/doctest
{envpython} -m doctest \
AUTHORS.rst \
CHANGELOG.rst \
CONTRIBUTING.rst \
README.rst \
SECURITY.rst
[testenv:manifest]
description = Check MANIFEST.in in a source package for completeness
deps = check-manifest
skip_install = true
commands = check-manifest -v
[testenv:build]
description = Build and test package distribution
skip_install = true
deps =
twine
check-wheel-contents
commands_pre =
python -m pip install -U pip setuptools wheel
python setup.py bdist_wheel -d {envtmpdir}/build
python setup.py sdist -d {envtmpdir}/build
commands =
twine check {envtmpdir}/build/*
check-wheel-contents {envtmpdir}/build
[pytest]
testpaths = tests
addopts =
--verbose
--ignore=.tox
[coverage:run]
branch = True
parallel = True
# A list of file name patterns, the files to leave
# out of measurement or reporting.
omit =
.tox/*
tests/*
*/__pycache__/*
[coverage:report]
precision = 2
show_missing = True
[flake8]
# Base flake8 configuration:
statistics = True
show-source = True
# TODO: max-complexity = 10
# Plugins:
import-order-style = smarkets
# A list of mappings of files and the codes that should be ignored for
# the entirety of the file:
per-file-ignores =
environ/__init__.py:F401,F403
environ/compat.py:F401
# Excluding some directories:
extend-exclude =
.tox
build*
dist
htmlcov