-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtox.ini
52 lines (46 loc) · 1.7 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
[tox]
envlist = py{37,38}, black, pylint, flake8, docs
isolated_build = True
[testenv]
# Doctests can be painful
# Luckily for us they are embedded in our source code as doccumentation thus distributed
# https://stackoverflow.com/questions/49254777/how-to-let-pytest-discover-and-run-doctests-in-installed-modules
# EITHER run pytest -vvv --doctest-modules {envsitepackagesdir}/ashpy tests --cov=ashpy --cov-report term-missing
# OR pass PY_IGNORE_IMPORTMISMATCH=1 as an env variable
setenv =
PYTHONPATH = {toxinidir}
deps =
-rrequirements/base.txt
-rrequirements/docs.txt
-rrequirements/test.txt
commands =
pytest {posargs} -vvv --doctest-modules {envsitepackagesdir}/ashpy tests --cov=ashpy --cov-report term-missing
[testenv:black]
description = Formatting with black and isort
deps =
{[testenv]deps}
-rrequirements/linting.txt
commands =
isort -rc {toxinidir}/src {toxinidir}/tests -sp {toxinidir}/pyproject.toml
black {toxinidir}/src {toxinidir}/tests
[testenv:pylint]
description = Linting with pylint
deps =
{[testenv]deps}
-rrequirements/linting.txt
skip_install = true
commands = - pylint --rcfile={toxinidir}/.pylintrc {toxinidir}/src {toxinidir}/tests
[testenv:flake8]
description = Linting with flake8
deps =
{[testenv]deps}
-rrequirements/linting.txt
skip_install = true
commands = - flake8 src tests
[testenv:docs]
deps =
-rrequirements/docs.txt
m2r
commands =
sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "{toxworkdir}/docs_out" --color -bhtml {posargs}
python -c 'import pathlib; print("\033[92m" ">>> Documentation available under " "\033[4m" "file://\{0\}""\033[0m".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'