forked from johnthagen/python-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
133 lines (119 loc) · 3.23 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
[flake8]
# Use the more relaxed max line length permitted in PEP8.
max-line-length = 99
# This ignore is required by black.
extend-ignore = E203
extend-exclude =
venv
# This is the configuration for the tox-gh-actions plugin for GitHub Actions
# https://github.com/ymyzk/tox-gh-actions
# This section is not needed if not using GitHub Actions for CI.
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38, fmt-check, lint, type-check, docs-api, docs-user-guide
3.9: py39
[tox]
# These are the default environments that will be run
# when ``tox`` is run without arguments.
envlist =
fmt-check
lint
type-check
py{36,37,38,39}
docs-api
docs-user-guide
skip_missing_interpreters = true
# Activate isolated build environment. tox will use a virtual environment
# to build a source distribution from the source tree. For build tools and
# arguments use the pyproject.toml file as specified in PEP-517 and PEP-518.
isolated_build = true
[testenv]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/dev-requirements.txt
commands =
# Use -bb to enable BytesWarnings as error to catch str/bytes misuse.
# Use -Werror to treat warnings as errors.
{envpython} -bb -Werror -m pytest \
--cov=fact --cov-report=html --cov-report=term {posargs}
[testenv:type-check]
skip_install = true
deps =
# It is important to install the main project requirements, as some
# packages many contain inline type hints (PEP 561) that mypy will use.
-r{toxinidir}/requirements.txt
-r{toxinidir}/dev-requirements.txt
commands =
mypy src tests
[testenv:lint]
skip_install = true
deps =
-r{toxinidir}/dev-requirements.txt
commands =
flake8
[testenv:fmt]
skip_install = true
deps =
-r{toxinidir}/dev-requirements.txt
commands =
isort .
black .
[testenv:fmt-check]
skip_install = true
deps =
-r{toxinidir}/dev-requirements.txt
commands =
isort --check .
black --check .
[testenv:docs-api]
skip_install = true
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/dev-requirements.txt
changedir = {toxinidir}/docs/api
commands =
{envpython} clean_docs.py
sphinx-apidoc --force --output-dir apidoc {toxinidir}/src/fact
sphinx-build -a -W . _build
[testenv:docs-api-serve]
skip_install = true
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/dev-requirements.txt
changedir = {toxinidir}/docs/api
commands =
{envpython} clean_docs.py
sphinx-apidoc --force --output-dir apidoc {toxinidir}/src/fact
sphinx-autobuild -a -W . _build
[testenv:docs-user-guide]
skip_install = true
deps =
-r{toxinidir}/dev-requirements.txt
changedir = {toxinidir}/docs/user_guide
commands =
mkdocs build
[testenv:docs-user-guide-serve]
skip_install = true
deps =
-r{toxinidir}/dev-requirements.txt
changedir = {toxinidir}/docs/user_guide
commands =
mkdocs serve
[testenv:docs-user-guide-github-pages]
skip_install = true
deps =
-r{toxinidir}/dev-requirements.txt
changedir = {toxinidir}/docs/user_guide
commands =
# See: https://squidfunk.github.io/mkdocs-material/publishing-your-site/
mkdocs gh-deploy --force
[testenv:licenses]
skip_install = true
recreate = true
deps =
-r{toxinidir}/requirements.txt
pip-licenses
commands =
pip-licenses {posargs}