generated from opentelekomcloud-docs/template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
481 lines (440 loc) · 15.9 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
[tox]
minversion = 3.1
envlist = py39,pep8
skipsdist = True
ignore_basepython_conflict = True
[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
deps =
-r{toxinidir}/requirements.txt
commands = stestr run {posargs}
stestr slowest
[testenv:pep8]
allowlist_externals =
doc8
commands =
doc8 doc/source README.rst
[testenv:venv]
deps =
-r{toxinidir}/requirements.txt
commands = {posargs}
# This env is invoked in the periodic pipeline and is therefore responsible to
# build all relevant docs at once.
[testenv:docs]
deps =
-r{toxinidir}/doc/requirements.txt
-c https://raw.githubusercontent.com/opentelekomcloud-docs/docs-constraints/main/constraints.txt
allowlist_externals =
mkdir
cp
sh
rm
sphinx-build
commands =
rm -rf doc/build/html doc/build/html_temp doc/build/doctrees
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html_temp
sphinx-minify --input-directory doc/build/html_temp/ --output-directory doc/build/html
{[testenv:best-practice]commands}
{[testenv:json-best-practice]commands}
{[testenv:permissions-configuration-guide]commands}
{[testenv:json-permissions-configuration-guide]commands}
{[testenv:api-ref]commands}
{[testenv:json-api-ref]commands}
{[testenv:umn]commands}
{[testenv:json-umn]commands}
{[testenv:s3api]commands}
{[testenv:json-s3api]commands}
{[testenv:tool-guide]commands}
{[testenv:json-tool-guide]commands}
{[testenv:parallel-file-system]commands}
{[testenv:json-parallel-file-system]commands}
{[testenv:swiftapi]commands}
{[testenv:json-swiftapi]commands}
[testenv:docs-pdf]
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:best-practice-pdf-docs]commands}
{[testenv:permissions-configuration-guide-pdf-docs]commands}
{[testenv:api-ref-pdf-docs]commands}
{[testenv:umn-pdf-docs]commands}
{[testenv:s3api-pdf-docs]commands}
{[testenv:tool-guide-pdf-docs]commands}
{[testenv:parallel-file-system-pdf-docs]commands}
{[testenv:swiftapi-pdf-docs]commands}
# HTML version
[testenv:best-practice]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html doc/best-practice/source doc/build/html_temp/best-practice
sphinx-minify --input-directory doc/build/html_temp/best-practice --output-directory doc/build/html/best-practice
mkdir -p best-practice/build/html
cp -av doc/build/html/best-practice best-practice/build/html
# Json version (for search)
[testenv:json-best-practice]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json doc/best-practice/source doc/build/json/best-practice
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p best-practice/build/json
cp -av doc/build/json/best-practice best-practice/build/json
# PDF version
[testenv:best-practice-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/best-practice/build/pdf
cp -r {toxinidir}/_templates doc/best-practice/source/_templates/
sphinx-build -W --keep-going -b latex doc/best-practice/source doc/best-practice/build/pdf/
bash -c "for f in doc/best-practice/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/best-practice/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/best-practice/build/pdf
mkdir -p doc/build/pdf
cp doc/best-practice/build/pdf/obs-best-practice.pdf doc/build/pdf/
# HTML version
[testenv:permissions-configuration-guide]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html doc/permissions-configuration-guide/source doc/build/html_temp/permissions-configuration-guide
sphinx-minify --input-directory doc/build/html_temp/permissions-configuration-guide --output-directory doc/build/html/permissions-configuration-guide
mkdir -p permissions-configuration-guide/build/html
cp -av doc/build/html/permissions-configuration-guide permissions-configuration-guide/build/html
# Json version (for search)
[testenv:json-permissions-configuration-guide]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json doc/permissions-configuration-guide/source doc/build/json/permissions-configuration-guide
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p permissions-configuration-guide/build/json
cp -av doc/build/json/permissions-configuration-guide permissions-configuration-guide/build/json
# PDF version
[testenv:permissions-configuration-guide-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/permissions-configuration-guide/build/pdf
cp -r {toxinidir}/_templates doc/permissions-configuration-guide/source/_templates/
sphinx-build -W --keep-going -b latex doc/permissions-configuration-guide/source doc/permissions-configuration-guide/build/pdf/
bash -c "for f in doc/permissions-configuration-guide/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/permissions-configuration-guide/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/permissions-configuration-guide/build/pdf
mkdir -p doc/build/pdf
cp doc/permissions-configuration-guide/build/pdf/obs-perms-cfg.pdf doc/build/pdf/
# HTML version
[testenv:api-ref]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html api-ref/source doc/build/html_temp/api-ref
sphinx-minify --input-directory doc/build/html_temp/api-ref --output-directory doc/build/html/api-ref
mkdir -p api-ref/build/html
cp -av doc/build/html/api-ref api-ref/build/html
# Json version (for search)
[testenv:json-api-ref]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json api-ref/source doc/build/json/api-ref
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p api-ref/build/json
cp -av doc/build/json/api-ref api-ref/build/json
# PDF version
[testenv:api-ref-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf api-ref/build/pdf
cp -r {toxinidir}/_templates api-ref/source/_templates/
sphinx-build -W --keep-going -b latex api-ref/source api-ref/build/pdf/
bash -c "for f in api-ref/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in api-ref/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C api-ref/build/pdf
mkdir -p doc/build/pdf
cp api-ref/build/pdf/obs-api-ref.pdf doc/build/pdf/
# HTML version
[testenv:umn]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html umn/source doc/build/html_temp/umn
sphinx-minify --input-directory doc/build/html_temp/umn --output-directory doc/build/html/umn
mkdir -p umn/build/html
cp -av doc/build/html/umn umn/build/html
# Json version (for search)
[testenv:json-umn]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json umn/source doc/build/json/umn
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p umn/build/json
cp -av doc/build/json/umn umn/build/json
# PDF version
[testenv:umn-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf umn/build/pdf
cp -r {toxinidir}/_templates umn/source/_templates/
sphinx-build -W --keep-going -b latex umn/source umn/build/pdf/
bash -c "for f in umn/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in umn/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C umn/build/pdf
mkdir -p doc/build/pdf
cp umn/build/pdf/obs-umn.pdf doc/build/pdf/
# HTML version
[testenv:s3api]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html doc/s3api/source doc/build/html_temp/s3api
sphinx-minify --input-directory doc/build/html_temp/s3api --output-directory doc/build/html/s3api
mkdir -p s3api/build/html
cp -av doc/build/html/s3api s3api/build/html
# Json version (for search)
[testenv:json-s3api]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json doc/s3api/source doc/build/json/s3api
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p s3api/build/json
cp -av doc/build/json/s3api s3api/build/json
# PDF version
[testenv:s3api-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/s3api/build/pdf
cp -r {toxinidir}/_templates doc/s3api/source/_templates/
sphinx-build -W --keep-going -b latex doc/s3api/source doc/s3api/build/pdf/
bash -c "for f in doc/s3api/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/s3api/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/s3api/build/pdf
mkdir -p doc/build/pdf
cp doc/s3api/build/pdf/obs-s3api.pdf doc/build/pdf/
# HTML version
[testenv:tool-guide]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html doc/tool/source doc/build/html_temp/tool-guide
sphinx-minify --input-directory doc/build/html_temp/tool-guide --output-directory doc/build/html/tool-guide
mkdir -p tool-guide/build/html
cp -av doc/build/html/tool-guide tool-guide/build/html
# Json version (for search)
[testenv:json-tool-guide]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json doc/tool/source doc/build/json/tool-guide
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p tool-guide/build/json
cp -av doc/build/json/tool-guide tool-guide/build/json
# PDF version
[testenv:tool-guide-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/tool/build/pdf
cp -r {toxinidir}/_templates doc/tool/source/_templates/
sphinx-build -W --keep-going -b latex doc/tool/source doc/tool/build/pdf/
bash -c "for f in doc/tool/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/tool/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/tool/build/pdf
mkdir -p doc/build/pdf
cp doc/tool/build/pdf/obs-tool-guide.pdf doc/build/pdf/
# HTML version
[testenv:parallel-file-system]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html doc/parallel-file-system/source doc/build/html_temp/parallel-file-system
sphinx-minify --input-directory doc/build/html_temp/parallel-file-system --output-directory doc/build/html/parallel-file-system
mkdir -p parallel-file-system/build/html
cp -av doc/build/html/parallel-file-system parallel-file-system/build/html
# Json version (for search)
[testenv:json-parallel-file-system]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json doc/parallel-file-system/source doc/build/json/parallel-file-system
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p parallel-file-system/build/json
cp -av doc/build/json/parallel-file-system parallel-file-system/build/json
# PDF version
[testenv:parallel-file-system-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/parallel-file-system/build/pdf
cp -r {toxinidir}/_templates doc/parallel-file-system/source/_templates/
sphinx-build -W --keep-going -b latex doc/parallel-file-system/source doc/parallel-file-system/build/pdf/
bash -c "for f in doc/parallel-file-system/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/parallel-file-system/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/parallel-file-system/build/pdf
mkdir -p doc/build/pdf
cp doc/parallel-file-system/build/pdf/obs-pfs.pdf doc/build/pdf/
# HTML version
[testenv:swiftapi]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
commands =
sphinx-build -W --keep-going -b html doc/swiftapi/source doc/build/html_temp/swiftapi
sphinx-minify --input-directory doc/build/html_temp/swiftapi --output-directory doc/build/html/swiftapi
mkdir -p swiftapi/build/html
cp -av doc/build/html/swiftapi swiftapi/build/html
# Json version (for search)
[testenv:json-swiftapi]
deps = {[testenv:docs]deps}
allowlist_externals =
cp
mkdir
sh
commands =
sphinx-build -W --keep-going -b json doc/swiftapi/source doc/build/json/swiftapi
# Drop data useless for the search - wrap it also with sh/xargs due to bugs
# in tox
sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf"
mkdir -p swiftapi/build/json
cp -av doc/build/json/swiftapi swiftapi/build/json
# PDF version
[testenv:swiftapi-pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
mkdir
make
bash
cp
commands =
rm -rf doc/swiftapi/build/pdf
cp -r {toxinidir}/_templates doc/swiftapi/source/_templates/
sphinx-build -W --keep-going -b latex doc/swiftapi/source doc/swiftapi/build/pdf/
bash -c "for f in doc/swiftapi/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true"
bash -c "for f in doc/swiftapi/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done"
make -C doc/swiftapi/build/pdf
mkdir -p doc/build/pdf
cp doc/swiftapi/build/pdf/obs-swiftapi.pdf 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'
[doc8]
ignore = D001
extensions = .rst, .yaml