-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtox.ini
108 lines (96 loc) · 3.27 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
[tox]
minversion = 3.1.0
envlist = pep8
ignore_basepython_conflict = true
[testenv]
basepython = python3
usedevelop = true
deps =
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
sitepackages = False
allowlist_externals =
rm
make
[testenv:pep8]
commands =
pre-commit run -a
flake8 otcdocstheme
[testenv:venv]
commands = {posargs}
[testenv:docs]
commands =
rm -rf doc/build/html doc/build/doctrees
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
{[testenv:blueprints]commands}
[testenv:blueprints]
commands =
rm -rf doc/build/blueprints
sphinx-build -W --keep-going -b html doc/blueprints/source doc/build/blueprints
[testenv:html]
commands =
rm -rf doc/build/html doc/build/doctrees api-ref/build
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
sphinx-build -a -E -W -d api-ref/build/doctrees -b html api-ref/source api-ref/build/html
[testenv:releasenotes]
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:api-ref]
commands =
rm -rf api-ref/build
sphinx-build -a -E -W -d api-ref/build/doctrees -b html api-ref/source api-ref/build/html
[testenv:pdf-docs]
deps =
{[testenv:docs]deps}
{[testenv:bindeps]deps}
allowlist_externals =
rm
mkdir
wget
make
bash
cp
commands =
mkdir -p doc/build/pdf
{[testenv:bindeps]commands}
mkdir -p {toxinidir}/_templates
wget -O {toxinidir}/_templates/longtable.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/longtable.tex.jinja
wget -O {toxinidir}/_templates/tabular.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/tabular.tex.jinja
wget -O {toxinidir}/_templates/tabulary.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/tabulary.tex.jinja
{[testenv:doc-pdf-docs]commands}
# PDF version
[testenv:doc-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/build/pdf
cp -r {toxinidir}/_templates doc/source/_templates/
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf/
bash -c "for f in doc/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/build/pdf
[testenv:bindeps]
deps =
bindep
allowlist_externals =
wget
rm
bash
commands =
rm -rf {toxinidir}/bindep.txt
rm -rf {toxinidir}/packages.txt
wget -O {toxinidir}/bindep.txt https://raw.githubusercontent.com/opentelekomcloud/otcdocstheme/main/bindep.txt
bash -c "bindep test -b -f {toxinidir}/bindep.txt > {toxinidir}/packages.txt || true"
bash -c 'if [ -s {toxinidir}/packages.txt ]; then if command -v apt &>/dev/null; then apt update && xargs apt install --no-install-recommends -y < {toxinidir}/packages.txt; fi; fi'
bash -c 'if [ -s {toxinidir}/packages.txt ]; then if command -v dnf &>/dev/null; then dnf install -y $(cat {toxinidir}/packages.txt); fi; fi'
[flake8]
exclude=.venv,.git,.tox,dist,doc,api-ref,*lib/python*,*egg,tools
show-source = True
enable-extensions = H203,H106