-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtox.ini
86 lines (78 loc) · 2.5 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
[tox]
envlist =
docs,
docs-linkcheck,
license,
pre-commit,
py36,
py37,
py38
minversion = 3.7
skip_missing_interpreters = true
ignore_basepython_conflict = true
[pytest]
markers = datafiles
addopts = -p no:warnings
[testenv]
basepython = python3
deps = -r{toxinidir}/requirements-test.txt
commands = pytest
usedevelop = true
[testenv:docs]
description = Build the documentation with sphinx
basepython = python3
deps = -rrequirements-docs.txt
extras = openstack
commands = sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
[testenv:docs-linkcheck]
description = Check the documentation links with sphinx
basepython = python3
deps = -rrequirements-docs.txt
extras = openstack
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
[testenv:latest-upstream]
description = Latest upstream test. Used for what exactly?
basepython = python3
deps = -r{toxinidir}/requirements-test.txt
commands =
pip install -U python-jenkins requests shade
pytest
[testenv:license]
description = Check all files for license header
basepython = python3
deps = lftools
commands =
lftools license check-dir lftools
lftools license check-dir -r '.+' shell
[testenv:pre-commit]
description = Precommit checks for black, gitlint, etc.
basepython = python3
allowlist_externals =
/bin/sh
deps =
pre-commit
passenv = HOME
commands =
pre-commit run --all-files --show-diff-on-failure
/bin/sh -c 'if ! git config --get user.name > /dev/null; then \
git config --global --add user.name "CI"; \
touch .git/REMOVE_USERNAME; fi'
/bin/sh -c 'if ! git config --get user.email > /dev/null; then \
git config --global --add user.email "[email protected]"; \
touch .git/REMOVE_USEREMAIL; fi'
/bin/sh -c "if [ -f .git/COMMIT_EDITMSG ]; then \
cp .git/COMMIT_EDITMSG .git/COMMIT_MSGTOX; else \
git log HEAD -n1 --pretty=%B > .git/COMMIT_MSGTOX; fi"
pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_MSGTOX
/bin/sh -c "rm -f .git/COMMIT_MSGTOX"
/bin/sh -c "if [ -f .git/REMOVE_USERNAME ]; then \
git config --global --unset user.name; \
rm -f .git/REMOVE_USERNAME; fi"
/bin/sh -c "if [ -f .git/REMOVE_USEREMAIL ]; then \
git config --global --unset user.email; \
rm -f .git/REMOVE_USEREMAIL; fi"
[testenv:reno]
description = OpenStack Reno checks
basepython = python3
deps = reno
commands = reno {posargs:--help}