-
Notifications
You must be signed in to change notification settings - Fork 46
/
tox.ini
67 lines (64 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
[tox]
# By default, .tox is the directory.
# Putting it in a non-dot file allows opening the generated
# documentation from file managers or browser open dialogs
# that will sometimes hide dot files.
# {toxinidir} - start directory, where it is invoked
# {envtmpdir} - tmp directory created under {toxinidir} for the specific environment
toxworkdir = {toxinidir}/.tox/build
# Do not build the package
skipsdist=True
[pycodestyle]
count = False
#ignore = E226,E302,E71
max-line-length = 120
statistics = True
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3
setenv =
PYTHONPATH = {toxinidir}/doc/api
# Running sphinx from inside the "doc" directory
# ensures it will not pick up any stray files that might
# get into a virtual environment under the top-level directory
# or other artifacts under build/
changedir = doc/api
# requirements.txt should be added to the dependencies
# Had to add here m2crypto!
# The only added dependency is sphinx
# If we were using extensions packaged separately, we would specify them here.
# A better practice is to specify a specific version of sphinx.
deps =
sphinx
structlog
m2crypto
# Everything must be in the dependency or whitelist (* is allowed here)
whitelist_externals =
pwd
echo
mkdir
sh
sed
mv
# Sphinx commands:
# - Apidoc to parse the source files
# - Command to build HTML (PDF or ebook are possible)
commands =
echo "Running Sphinx to generate HTML docs"
pwd
mkdir -p code html
sphinx-apidoc -f -F -P -l -H GlideinWMS -A 'The GlideinWMS Team' -V '3.p3' -o code glideinwms
# Index customization. tox does not support pipes or redirection
sh -c "sed -e $'s/Welcome to GlideinWMS\'s documentation\!/GlideinWMS API documentation/' -e 's/======================================/============================/' code/index.rst > code/index.subst"
mv code/index.subst code/index.rst
# Removing -W because there are several error in the docstrings formatting
# -w logfile to output warnings
# -D html_theme_path=path1,path2
# html_theme = "classic"
sphinx-build -c ./ -b html -D html_theme='classic' -a -w html/sphinx_build_warnings.txt -d {envtmpdir}/doctreescache code html
# Adding the code to the index file is not working, it is not finding the code
# sphinx-build -W -b html -d {envtmpdir}/doctrees2 . {envtmpdir}/html2
# In other sections you can refer to section variables
#deps = {[testenv:docs]deps}
#basepython = {[testenv:docs]basepython}
#changedir = {envtmpdir}/../../docs/tmp/doctrees