forked from svenevs/exhale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
106 lines (100 loc) · 3.02 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
[tox]
envlist = py, flake8
[testenv]
passenv =
PYTHONWARNINGS
TOXENV
CI
# See TODO below, skipping install since I don't know what is going on...
# usedevelop = true
skip_install = true
# NOTE: environment variables *MUST* include the `==`, e.g.,
# SPHINX_VERSION="==3.0.0" tox -e py
# This way, if the variable is not set, it uses the latest version.
deps =
# TODO: drop this when sphinx 3.x is dropped.
# https://github.com/sphinx-doc/sphinx/issues/10291
Jinja2<3.1
# requirements for exhale
sphinx{env:SPHINX_VERSION:}
breathe{env:BREATHE_VERSION:>=4.32.0}
beautifulsoup4
# NOTE: for dev convenience, see https://github.com/svenevs/exhale/issues/131
lxml>=4.6.4
six
# testing requirements
# NOTE: see .github/actions/testing_projects.yaml, updates here need to go there.
pytest
pytest-raises>=0.10
# testing coverage plugin (`tox -e py -- --cov-report xml:coverage.xml --cov`)
pytest-cov
# this is just because I like to have color in my debugger...
ipdb
commands =
# Print out the environment details of what's running in the tests.
{envpython} -c 'import breathe; \
import sphinx; \
import subprocess; \
import sys; \
y = "\033[33;1m"; \
b = "\033[34;1m"; \
m = "\033[35;1m"; \
c = "\033[36;1m"; \
clear = "\033[0m"; \
doxygen_proc = subprocess.run( \
["doxygen", "--version"], check=True, capture_output=True); \
py_version = ".".join(str(i) for i in sys.version_info[0:3]); \
doxygen_version = doxygen_proc.stdout.decode("utf-8").strip(); \
print(f"\{y\}Doxygen version: \{doxygen_version\}\{clear\}"); \
print(f"\{b\}Breathe version: \{breathe.__version__\}\{clear\}"); \
print(f"\{m\}Sphinx version: \{sphinx.__version__\}\{clear\}"); \
print(f"\{c\}Python version: \{py_version\}\{clear\}")'
pytest {toxinidir} {posargs}
[testenv:flake8]
skip_install = true
deps =
flake8
flake8-docstrings
flake8-import-order
pep8-naming
flake8-colors
commands =
flake8 {posargs} setup.py testing/
# TODO: many intentional flake8 failures in exhale/
# flake8 {posargs} setup.py exhale/ testing/
[testenv:docs]
changedir = docs
deps =
-rdocs/requirements.txt
commands =
sphinx-build -W -n -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:linkcheck]
changedir = docs
deps =
-rdocs/requirements.txt
commands =
sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees . {envtmpdir}/linkcheck
[testenv:dist]
deps =
build[virtualenv]
twine
skip_install = true
commands =
# Builds sdist and then wheel from sdist.
{envpython} -m build .
# Validate the markup
twine check dist/*
[testenv:clean]
whitelist_externals =
find
rm
deps =
skip_install = true
commands =
rm -rf build/
rm -rf dist/
rm -rf exhale.egg-info/
rm -rf .eggs/
rm -rf pip-wheel-metadata/
find . -name "*.pyc" -exec rm -f \{\} +
find . -name "__pycache__" -type d -exec rm -rf \{\} +