forked from ryan-roemer/sphinx-bootstrap-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
95 lines (87 loc) · 2.96 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
# NOTE: adding / removing tests? Please update demo/source/maintenance.rst!
[tox]
# By default, run tests and linting checks when invoking `tox`.
envlist = py, lint
[testenv]
passenv = PYTHONWARNINGS
deps =
# NOTE: SPHINX_VERSION environment variable must have `==`, e.g.:
# SPHINX_VERSION="==1.8.5" tox
# On Unix, the double quotes are not necessary provided no spaces.
sphinx{env:SPHINX_VERSION:}
changedir = demo
commands =
# Not really a test, but if we can build the docs then it works with this
# combination of python / sphinx.
{envpython} --version
sphinx-build --version
sphinx-build -W -n -b html -d {envtmpdir}/doctrees source {envtmpdir}/html
# Build demo site in nitpicky / warnings=error mode.
[testenv:docs]
changedir = demo
commands =
sphinx-build -W -n -b html -d {envtmpdir}/doctrees source {envtmpdir}/html
# Validate all links in the demo website.
[testenv:linkcheck]
changedir = demo
commands =
sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees source {envtmpdir}/linkcheck
# Open a development server. See options here:
# https://github.com/GaretJax/sphinx-autobuild
#
# Example run on port other than 8000:
# tox -e server -- -p 8080
[testenv:server]
changedir = {toxinidir}
usedevelop = true
recreate = true
deps =
{[testenv]deps}
sphinx-autobuild
commands =
sphinx-autobuild -a -E \
-b html \
-d {envtmpdir}/doctrees \
--watch {toxinidir}/sphinx_bootstrap_theme \
{posargs} \
{toxinidir}/demo/source \
{envtmpdir}/html
# Linting checks.
[testenv:lint]
changedir = {toxinidir}
skip_install = true
deps =
flake8
commands =
flake8 {posargs} setup.py sphinx_bootstrap_theme
# Package for uploading to PyPI. Everything is put in dist/ folder.
[testenv:dist]
changedir = {toxinidir}
passenv =
{[testenv]passenv}
skip_install = true
deps =
readme_renderer
twine
commands =
{envpython} -c "import os.path as osp, sys; \
dist_path = osp.join('{toxinidir}', 'dist'); \
dist_exists = osp.exists(dist_path); \
m = '[X] Delete the ' + dist_path + ' folder.\n' if dist_exists else ''; \
sys.stderr.write(m); \
sys.exit(int(dist_exists))"
{envpython} setup.py sdist
# TODO: this last one goes away once we ditch python 2 (via Sphinx 2.x+).
{envpython} setup.py bdist_wheel --universal
twine check dist/*
# Dummy env for helping with cleanup of build related artifacts.
[testenv:clean]
skip_install = true
deps =
commands =
{envpython} -c "import os.path as osp; from shutil import rmtree; \
root = '{toxinidir}'; \
rmtree(osp.join(root, 'build'), ignore_errors=True); \
rmtree(osp.join(root, 'dist'), ignore_errors=True); \
rmtree(osp.join(root, 'sphinx_bootstrap_theme.egg-info'), ignore_errors=True); \
rmtree(osp.join(root, 'sphinx_bootstrap_theme', '__pycache__'), ignore_errors=True)"