-
Notifications
You must be signed in to change notification settings - Fork 20
/
tox.ini
100 lines (89 loc) · 2.43 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
[tox]
envlist =
lint
build
tests
lint_folders =
"{toxinidir}/src" \
"{toxinidir}/tests" \
"{toxinidir}/docs/src/" \
"{toxinidir}/examples"
[testenv:build]
description = Builds the package and checks integrity
usedevelop = true
deps =
build
check-manifest
twine
allowlist_externals = bash
commands_pre =
bash -c "if [ -e {toxinidir}/dist/*tar.gz ]; then unlink {toxinidir}/dist/*.whl; fi"
bash -c "if [ -e {toxinidir}/dist/*tar.gz ]; then unlink {toxinidir}/dist/*.tar.gz; fi"
commands =
python -m build
twine check dist/*.tar.gz dist/*.whl
check-manifest {toxinidir}
[testenv:tests]
description = Runs the tests
usedevelop = true
changedir = tests
deps =
ase
coverage[toml]
parameterized
pytest
pytest-cov
tqdm
commands =
# Run unit tests
pytest --cov {posargs}
# Run documentation tests
pytest --doctest-modules --pyargs skmatter {posargs}
# after executing the pytest assembles the coverage reports
commands_post =
coverage xml
[testenv:lint]
description = Checks the code and doc for programmatic and stylistic errors
skip_install = true
deps =
black
blackdoc
ruff
isort
sphinx-lint
commands =
ruff check {[tox]lint_folders}
black --check --diff {[tox]lint_folders}
blackdoc --check --diff {[tox]lint_folders}
isort --check-only --diff {[tox]lint_folders}
sphinx-lint --enable all --max-line-length 88 \
-i "{toxinidir}/docs/src/examples" \
{[tox]lint_folders} "{toxinidir}/README.rst"
[testenv:{format,format-unsafe}]
description =
format: Formats files in working directory.
format-unsafe: Formats files in working directory. Fixes more linter errors
but might alter code logic. Result of this formatting should
be double checked.
skip_install = true
deps =
ruff
black
blackdoc
isort
commands =
format: ruff check --fix {[tox]lint_folders}
format-unsafe: ruff check --fix --unsafe-fixes {[tox]lint_folders}
black {[tox]lint_folders}
blackdoc {[tox]lint_folders}
isort {[tox]lint_folders}
[testenv:docs]
description = Builds the documentation
usedevelop = true
deps =
-r docs/requirements.txt
# The documentation runs "examples" to produce outputs via sphinx-gallery.
extras = examples
commands =
sphinx-build {posargs:-E} -W -b doctest docs/src docs/build/doctest
sphinx-build {posargs:-E} -W -b html docs/src docs/build/html