forked from scikit-learn-contrib/scikit-matter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
86 lines (76 loc) · 2.22 KB
/
tox.ini
File metadata and controls
86 lines (76 loc) · 2.22 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
[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 tests
usedevelop = true
deps = -r tests/requirements.txt
commands =
# Run unit tests
pytest {posargs}
# Run documentation tests
pytest --doctest-modules --pyargs skmatter {posargs}
[testenv:tests-dev]
description = Runs tests against scikit-learn dev version
deps = -r tests/requirements.txt
commands_pre =
python -m pip install \
--force-reinstall \
--no-deps \
git+https://github.com/scikit-learn/scikit-learn.git
commands =
pytest {posargs}
[testenv:lint]
description = Checks the code and doc for programmatic and stylistic errors
skip_install = true
deps =
ruff
sphinx-lint
commands =
ruff format --diff {[tox]lint_folders}
ruff check {[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
commands =
ruff format {[tox]lint_folders}
ruff check --fix-only {[tox]lint_folders} "{toxinidir}/README.rst" {posargs}
[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 html docs/src docs/build/html