-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathtox.ini
More file actions
155 lines (138 loc) · 3.3 KB
/
tox.ini
File metadata and controls
155 lines (138 loc) · 3.3 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
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
[tox]
minversion = 3.18.0
requires = virtualenv>=20.4.2
envlist = pep8,py3,functional
# this allows tox to infer the base python from the environment name
# and override any basepython configured in this file
ignore_basepython_conflict=true
[testenv]
usedevelop = true
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
allowlist_externals =
find
bash
isort
echo
passenv =
*_proxy
*_PROXY
[testenv:venv]
deps =
{[testenv]deps}
extras =
commands =
{posargs}
[testenv:policyenv]
deps =
{[testenv]deps}
description =
Policy Env.
extras =
commands =
bash tools/post_install.sh
{posargs}
[testenv:mypy]
description =
Run type checks.
envdir = {toxworkdir}/shared
extras =
commands =
mypy skyline_apiserver
[testenv:pep8]
skip_install = true
basepython = python3.12
description =
Run style checks.
envdir = {toxworkdir}/shared
deps =
{[testenv]deps}
extras =
commands =
{[testenv:mypy]commands}
isort --check-only --diff skyline_apiserver
black --check --diff --color skyline_apiserver --line-length 98
flake8 {posargs} .
[testenv:py{3,39,310,311,312,313}]
setenv =
PYTHONPATH = {toxinidir}
description =
Run pytest.
deps =
{[testenv]deps}
extras =
commands =
pytest {posargs:-v --cov=skyline_apiserver --cov-report html}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
# Ignore D001 since we allow lines in excess of 79 characters.
doc8 --ignore D001 --ignore-path .tox --ignore-path .venv --ignore-path doc/build --ignore-path skyline_apiserver.egg-info -e .txt -e .rst -e .inc
allowlist_externals =
rm
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:releasenotes]
description =
Generate release notes.
envdir = {toxworkdir}/shared
commands =
sphinx-build -W --keep-going -b html -j auto releasenotes/source releasenotes/build/html
[testenv:genswagger]
description =
Generate swagger files.
envdir = {toxworkdir}/shared
allowlist_externals = skyline-swagger-generator
commands =
skyline-swagger-generator -o swagger.json
[testenv:genconfig]
description =
Generate config files.
envdir = {toxworkdir}/shared
allowlist_externals = skyline-sample-config-generator
commands =
skyline-sample-config-generator -o etc/skyline.yaml.sample
[testenv:gennginx]
description =
Generate nginx config files.
deps =
{[testenv]deps}
skyline-console
commands =
skyline-nginx-generator -o etc/nginx.conf
[testenv:functional]
commands =
echo "TODO: Add functional test for skyline-apiserver"
[testenv:pep8-format]
description =
Run code format.
envdir = {toxworkdir}/shared
deps =
{[testenv]deps}
extras =
commands =
isort skyline_apiserver
black skyline_apiserver --line-length 98
[flake8]
# E203 whitespace before ':'
extend-ignore = E203,E231
max-line-length = 99
max-doc-length = 99
show-source = True
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes