-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathtox.ini
More file actions
109 lines (91 loc) · 2.39 KB
/
tox.ini
File metadata and controls
109 lines (91 loc) · 2.39 KB
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
[tox]
envlist =
flake8
py{36,37,38,39,310}
docs
mypy
isolated_build = True
[testenv]
description = Run test suite for {basepython}
allowlist_externals = make
commands = pytest {posargs:}
deps =
pytest
pytest-cov
setenv =
PIP_DISABLE_PIP_VERSION_CHECK = 1
[testenv:black]
description = Check for formatting changes
basepython = python3
deps = black
commands = black --check {posargs:.}
[testenv:flake8]
description = Check code style
basepython = python3
deps = flake8
commands = flake8 {posargs:}
[testenv:mypy]
description = Check code style
basepython = python3
deps = mypy
commands = mypy {posargs:--ignore-missing-imports --check-untyped-defs src}
[testenv:docstrings]
description = Check for PEP257 compatible docstrings
basepython = python3
deps = docformatter
commands = docformatter --check {posargs:--pre-summary-newline -r src}
[testenv:checks]
description = Run code style checks
basepython = python3
deps =
{[testenv:black]deps}
{[testenv:flake8]deps}
{[testenv:mypy]deps}
{[testenv:docstrings]deps}
commands =
{[testenv:black]commands}
{[testenv:flake8]commands}
{[testenv:mypy]commands}
{[testenv:docstrings]commands}
[testenv:docs]
description = Build HTML documentation
basepython = python3
deps = -r{toxinidir}/docs/requirements.txt
skip_install = true
allowlist_externals =
make
rm
echo
sed
commands_pre =
sphinx-apidoc --module-first -f --separate -H semver -o docs/_api src/semver src/semver/_types.py src/semver/_deprecated.py
# we don't need this, it just add another level and it's all in docs/api.rst
- rm docs/_api/modules.rst
# Include the semver.__about__ module before semver.cli:
sed -i '/semver\.cli/i\ \ \ semver.__about__' docs/_api/semver.rst
commands =
make -C docs html
commands_post =
echo "Find the HTML documentation at {toxinidir}/docs/_build/html/index.html"
[testenv:man]
description = Build the manpage
basepython = python3
deps = sphinx
skip_install = true
commands = make -C docs man
[testenv:prepare-dist]
description = Prepare for TestPyPI
basepython = python3
deps =
wheel
twine
commands =
python3 setup.py sdist bdist_wheel
twine check dist/*
[testenv:changelog]
description = Run towncrier to check, build, or create the CHANGELOG.rst
basepython = python3
deps =
git+https://github.com/twisted/towncrier.git
commands =
towncrier {posargs:build --draft}