-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathtox.ini
More file actions
98 lines (88 loc) · 2.29 KB
/
tox.ini
File metadata and controls
98 lines (88 loc) · 2.29 KB
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
[tox]
min_version = 4.0
requires =
tox>=4.31
# these are the default environments, i.e. the list of tests running when you
# execute `tox` in the command-line without anything else
envlist = lint, build, upet-tests, upet-tests-dev, pet-mad-dos-tests, pet-mad-tests-dev
[testenv]
passenv = *
lint_folders =
"{toxinidir}/docs/src/" \
"{toxinidir}/examples/" \
"{toxinidir}/src/" \
"{toxinidir}/tests/"
[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/generated_examples" \
{[testenv]lint_folders} "{toxinidir}/README.md"
[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} "{toxinidir}/README.md" {posargs}
[testenv:upet-tests]
description = Run basic package tests with pytest
passenv = *
deps =
pytest
changedir = tests/upet
allowlist_externals = bash
commands =
pytest {posargs}
[testenv:upet-tests-dev]
description = Run basic package tests against metatrain dev version
deps =
pytest
changedir = tests/upet
commands =
pip install "metatrain @ git+https://github.com/metatensor/metatrain.git"
pytest {posargs}
[testenv:pet-mad-dos-tests]
description = Run basic package tests with pytest
deps =
pytest
changedir = tests/pet_mad_dos
allowlist_externals = bash
commands =
pytest {posargs}
[testenv:build]
description = builds the package and checks integrity
usedevelop = true
deps =
build
check-manifest
twine
allowlist_externals = rm
commands_pre =
rm -f {toxinidir}/dist/*.whl
rm -f {toxinidir}/dist/*.tar.gz
commands =
python -m build
twine check dist/*.tar.gz dist/*.whl
check-manifest {toxinidir}
[testenv:docs]
description = builds the documentation with sphinx
deps =
-r docs/requirements.txt
commands =
sphinx-build \
{posargs:-E} \
--builder html \
--doctree-dir docs/build/doctree \
--fail-on-warning \
docs/src docs/build/html