-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
145 lines (130 loc) · 3.1 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
[tox]
basepython = python3.12
envlist =
lint
pyright
mypy
py313 # EoL: 2029-10
py312 # EoL: 2028-10
py311 # EoL: 2027-10
py310 # EoL: 2026-10
py39 # EoL: 2025-10
; py38 # EoL: 2024-10
; py37 # Eol: 2023-06-27
coverage,
skip_missing_interpreters = true
# TOX Test Environment
[testenv]
# usedevelop = True
extras =
# test
passenv =
# LC_ALL
# LANG
# Note: also honors .coveragerc:
deps =
fabulist
pydot
pytest
pytest-cov
pytest-html
rdflib
py39: typing-extensions>=4.0
py310: typing-extensions>=4.0
setenv =
COVERAGE_FILE=.coverage.{envname}
; allowlist_externals =
; which
commands =
# See settings in pyproject.toml
# Run everything from /tests folder:
python -V
; which python
; pip list
pytest -ra -v -x --durations=10 --cov=nutree --html=build/pytest/report-{envname}.html --self-contained-html {posargs}
[testenv:py38]
commands =
# latest version of fabulist is not compatible with python 3.8
pip uninstall fabulist -y
{[testenv]commands}
[testenv:coverage]
skip_install = true
deps =
coverage
setenv =
COVERAGE_FILE = .coverage
commands =
coverage erase
coverage combine
coverage html
coverage report --fail-under=95.0
[testenv:lint]
skip_install = true
deps =
ruff
commands =
ruff -V
ruff check nutree tests docs/jupyter setup.py
ruff format --check nutree tests docs/jupyter setup.py
[testenv:format]
description = Reformat python code using ruff (Black, isort, and pyupgrade)
skip_install = true
deps =
ruff
changedir = {toxinidir}
commands =
ruff check --fix nutree tests docs/jupyter setup.py
ruff format nutree tests docs/jupyter setup.py
{[testenv:lint]commands}
[testenv:pyright]
skip_install = true
deps =
pyright
changedir = {toxinidir}
commands =
pyright nutree tests
; ignore_outcome = true
[testenv:mypy]
skip_install = true
deps =
lxml
mypy
changedir = {toxinidir}
commands =
mypy nutree tests --html-report build/mypy
ignore_outcome = true
[testenv:docs]
description = Build Sphinx documentation (output directory: docs/sphinx-build)
deps =
furo
fabulist
# pandoc # for jupyter notebook RST conversion
pydot
rdflib
sphinx
sphinx_rtd_theme
myst-parser[linkify]
sphinxcontrib-googleanalytics
sphinxcontrib-mermaid
allowlist_externals =
jupyter
changedir = docs
commands =
; jupyter nbconvert --to rst --output-dir sphinx jupyter/take_the_tour.ipynb
jupyter nbconvert --to markdown --output-dir sphinx jupyter/take_the_tour.ipynb
; jupyter nbconvert --execute --to rst --output-dir sphinx jupyter/take_the_tour.ipynb
# http://www.sphinx-doc.org/en/master/man/sphinx-build.html
sphinx-build -b html sphinx sphinx-build
[testenv:benchmarks]
description = Run 'pytest --benchmarks' on all Python versions
; envlist = py38, py39, py310, py311, py312
skip_install = true
changedir = {toxinidir}
basepython = py312
; basepython = py39
; basepython = py{38, 39}
; deps =
; pytest
commands =
python -V
pytest -k test_bench -o addopts="" --benchmarks