-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
109 lines (86 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
97
98
99
100
101
102
103
104
105
106
107
108
109
[tox]
# https://github.com/tox-dev/tox/issues/3238
requires = tox==4.14.0
envlist =
lint
tests
torch-tests
[testenv]
lint-folders = python setup.py
package = external
package_env = build-vesin
[testenv:build-vesin]
passenv = *
deps =
cmake
setuptools
wheel
commands =
pip wheel python/vesin --no-deps --no-build-isolation --check-build-dependencies --wheel-dir {envtmpdir}/dist
[testenv:tests]
passenv = *
description = Run the tests of the vesin Python package
deps =
ase
pytest
changedir = python/vesin
commands =
pytest {posargs}
[testenv:torch-tests]
passenv = *
description = Run the tests of the vesin-torch Python package
deps =
pytest
torch
metatensor-torch >=0.6,<0.7
numpy
cmake
setuptools
wheel
changedir = python/vesin-torch
commands =
pip install . --no-deps --no-build-isolation --check-build-dependencies
# Make torch.autograd.gradcheck works with pytest
python {toxinidir}/scripts/pytest-dont-rewrite-torch.py
pytest {posargs}
[testenv:cxx-tests]
passenv = *
description = Run the C++ tests
package = skip
deps = cmake
commands =
cmake -B {envtmpdir} -S vesin -DVESIN_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build {envtmpdir} --config Debug
ctest --test-dir {envtmpdir} --build-config Debug
[testenv:lint]
description = Run linters and formatter
package = skip
deps =
ruff
commands =
ruff format --diff {[testenv]lint-folders}
ruff check {[testenv]lint-folders}
[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}
[testenv:docs]
passenv = *
description = Invoke sphinx-build to build the HTML docs
deps =
sphinx
breathe >=4.33 # C++ => sphinx through doxygen
furo # sphinx theme
sphinx-design # helpers for nicer docs website (tabs, grids, cards, …)
torch
metatensor-torch >=0.6,<0.7
cmake
setuptools
wheel
commands =
pip install python/vesin-torch --no-deps --no-build-isolation --check-build-dependencies
sphinx-build -d docs/build/doctrees -W -b html docs/src docs/build/html