forked from benoitc/gunicorn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
104 lines (94 loc) · 2.95 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
[tox]
envlist =
py{37,38,39,310,311,312,py3},
lint,
docs-lint,
pycodestyle,
run-entrypoint,
run-module,
[testenv]
package = editable
extras = testing
commands =
python -m coverage run --source=gunicorn -m pytest -v {posargs}
python -m coverage xml
[testenv:mindep]
# this need not match default testenv. both editable & wheel must work!
package = wheel
extras = testing-mindep
commands =
python -m pip freeze
python -m coverage run -m pytest -v {posargs}
python -m coverage xml
[testenv:run-entrypoint]
package = wheel
deps =
# entry point: console script (provided by setuptools from pyproject.toml)
commands = python -c 'import subprocess; cmd_out = subprocess.check_output(["gunicorn", "--version"])[:79].decode("utf-8", errors="replace"); print(cmd_out); assert cmd_out.startswith("gunicorn ")'
[testenv:run-module]
package = wheel
deps =
# runpy (provided by module.__main__)
commands = python -c 'import sys,subprocess; cmd_out = subprocess.check_output([sys.executable, "-m", "gunicorn", "--version"])[:79].decode("utf-8", errors="replace"); print(cmd_out); assert cmd_out.startswith("gunicorn ")'
[testenv:format]
# type linting as consumers use it
package = sdist
extras = style-types
allowlist_externals =
git
bash
commands =
# isort --check-only will exit 0 on no change, 1 on change
bash -c 'git ls-files -z "**.pyi" | xargs --null python -m isort --py=310 --check-only'
# black --check will exit 0 on no change, 1 on change, and 123 on error
bash -c 'git ls-files -z "**.pyi" | xargs --null python -m black --target-version=py310 --check'
# pyupgrade has no readonly option - will set exit code nonzero if writing
bash -c 'git ls-files -z "**.pyi" | xargs --null python -m pyupgrade --py310-plus'
[testenv:mypy]
package = wheel
# enhanced by installing extras
# mypy wants to look at all imported modules (or their separately distributed stubs)
extras =
lint-types
testing
commands =
python -m mypy --exclude=tests/requests/ -- gunicorn tests
python -m mypy.stubtest -- gunicorn
[testenv:lint]
no_package = true
extras = lint-code
commands =
pylint -j0 \
--max-line-length=120 \
gunicorn \
tests/test_e2e.py \
tests/test_arbiter.py \
tests/test_config.py \
tests/test_http.py \
tests/test_invalid_requests.py \
tests/test_logger.py \
tests/test_pidfile.py \
tests/test_sock.py \
tests/test_ssl.py \
tests/test_statsd.py \
tests/test_systemd.py \
tests/test_util.py \
tests/test_valid_requests.py
[testenv:docs-lint]
no_package = true
allowlist_externals =
rst-lint
bash
grep
extras = lint-docs
commands =
rst-lint README.rst docs/README.rst
bash -c "(set -o pipefail; rst-lint --encoding utf-8 docs/source/*.rst docs/README.rst | grep -v 'Unknown interpreted text role\|Unknown directive type'); test $? == 1"
[testenv:pycodestyle]
no_package = true
commands =
pycodestyle gunicorn
extras = lint-code
[pycodestyle]
max-line-length = 120
ignore = E129,W503,W504,W606