-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
96 lines (85 loc) · 2.21 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
[tox]
envlist =
lint
build
tests
[testenv]
passenv = *
lint_folders =
"{toxinidir}/docs/src" \
"{toxinidir}/examples" \
"{toxinidir}/src" \
"{toxinidir}/tests"
test_options = \
--cov \
--cov-append \
--cov-report= \
--import-mode=append
[testenv:build]
description = Asserts package build 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 = Run ALL test suite with pytest and {basepython}.
usedevelop = true
deps =
metatensor-operations
-r tests/requirements.txt
extras = metatensor
commands =
# Run unit tests
pytest {[testenv]test_options} {posargs}
# Run documentation tests
pytest --doctest-modules --pyargs torchpme
[testenv:tests-min]
description = Run the minimal core tests with pytest and {basepython}.
usedevelop = true
deps = -r tests/requirements.txt
commands =
# Run unit tests
pytest {[testenv]test_options} {posargs}
[testenv:lint]
description = Run linters and type checks
package = skip
deps =
ruff
mypy
sphinx-lint
commands =
ruff format --diff {[testenv]lint_folders}
ruff check {[testenv]lint_folders}
mypy {[testenv]lint_folders}
sphinx-lint \
--enable all \
--disable line-too-long \
-i "{toxinidir}/docs/src/examples" \
{[testenv]lint_folders} "{toxinidir}/README.rst"
[testenv:format]
description = Abuse tox to do actual formatting on all files.
package = skip
deps = ruff
commands =
ruff format {[testenv]lint_folders}
ruff check --fix-only {[testenv]lint_folders} {posargs}
[testenv:docs]
description = Building the package documentation.
usedevelop = true
deps =
-r docs/requirements.txt
# The documentation runs "examples" to produce outputs via sphinx-gallery.
extras =
examples
metatensor
commands =
sphinx-build {posargs:-E} -d docs/build/doctrees -W -b html docs/src docs/build/html