This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
101 lines (90 loc) · 2.42 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
[tox]
ignore_basepython_conflict = true
# these are the default environments, i.e. the list of tests running when you
# execute `tox` in the command-line without anything else
envlist =
core-numpy-tests
core-torch-tests
torch-tests
lint
lint_folders = {toxinidir}/examples {toxinidir}/src {toxinidir}/tests
[testenv]
# we use by default the cpu version of torch, if the cuda version is desired
# please overwrite the PIP_EXTRA_INDEX_URL
setenv =
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu
[testenv:core-numpy-tests]
description = Runs Python tests with core
usedevelop = true
deps =
ase
pytest
commands =
pytest --import-mode=append {posargs}
[testenv:core-torch-tests]
description = Runs Python tests only with metatensor-core
usedevelop = {[testenv:core-numpy-tests]usedevelop}
deps =
{[testenv:core-numpy-tests]deps}
torch
commands =
{[testenv:core-numpy-tests]commands}
[testenv:torch-tests]
description = Runs Python tests with metatensor-torch
usedevelop = {[testenv:core-numpy-tests]usedevelop}
extras = torch
deps =
{[testenv:core-numpy-tests]deps}
commands =
{[testenv:core-numpy-tests]commands}
[testenv:lint]
description = Run linters
skip_install = true
deps =
flake8
flake8-bugbear
black
isort
commands =
flake8 {[tox]lint_folders}
black --check --diff {[tox]lint_folders}
isort --check-only --diff {[tox]lint_folders}
[testenv:format]
description =
Abuse tox to do actual formatting. Users can call `tox -e format` to run
formatting on all files.
skip_install = true
deps =
black
isort
commands =
black {[tox]lint_folders}
isort {[tox]lint_folders}
[testenv:docs]
description = Build the documentation with sphinx
usedevelop = true
setenv =
PIP_EXTRA_INDEX_URL={env:PIP_EXTRA_INDEX_URL:https://download.pytorch.org/whl/cpu}
extras = torch
deps =
-r docs/requirements.txt
commands = sphinx-build {posargs:-E} -W -b html docs/src docs/build/html
[testenv:build]
description = Build sdist and a wheel for python
deps =
build
check-manifest
twine
allowlist_externals =
bash
commands =
# check building sdist and wheels from a checkout
python -m build
twine check dist/*.tar.gz
twine check dist/*.whl
check-manifest {toxinidir}
# check building wheels from the sdist
bash -c "pip wheel --verbose dist/equisolve-*.tar.gz -w dist/test"
[flake8]
max_line_length = 88
extend-ignore = E203