-
Notifications
You must be signed in to change notification settings - Fork 5
/
tox.ini
157 lines (143 loc) · 3.99 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
146
147
148
149
150
151
152
153
154
155
156
157
; a generative tox configuration, see: https://testrun.org/tox/latest/config.html#generative-envlist
; {toxinidir} is the directory where tox.ini is located
[tox]
envlist =
clean,
check,
py38,
report,
docs,
profile,
py{38,39,310,311}-pandas{12,15,20},
requirements
[testenv]
basepython =
py38: {env:TOXPYTHON:python3.8}
{clean,check,report,codecov,spell}: {env:TOXPYTHON:python3}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
{py311,docs,profile,citation}: {env:TOXPYTHON:python3.11}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
passenv =
*
usedevelop = false
deps =
-r{toxinidir}/requirements/base.txt
pytest
pytest-cov
commands =
{posargs:pytest --cov --cov-report=term-missing -vv tests}
[testenv:py{38,39,310,311}-pandas{12,15,20,21}]
deps =
pandas12: pandas==1.2.2
pandas15: pandas==1.5.3
pandas20: pandas==2.0.0
pandas21: pandas==2.1.0
pytest
pytest-cov
[testenv:py3-latest]
deps =
pytest
pytest-xdist
commands =
{posargs:pytest -n auto -vv tests}
[testenv:spell]
setenv =
SPELLCHECK=1
commands =
sphinx-build -b spelling docs dist/docs
skip_install = true
deps =
-r{toxinidir}/docs/requirements.txt
sphinxcontrib-spelling
pyenchant
[testenv:docs]
deps =
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/docs/requirements.txt
; require setuptools_scm for getting version info
setuptools_scm
commands =
sphinx-apidoc -e -f -o {toxinidir}/docs/reference {toxinidir}/src/tlo
; Generate API documentation for TLO methods
python docs/tlo_methods_rst.py
; Generate data sources page
python docs/tlo_data_sources.py
; Generate contributors page
python docs/tlo_contributors.py
; Generate resources files page
python docs/tlo_resources.py
; Generate HSI events listing
python src/tlo/analysis/hsi_events.py --output-file docs/_hsi_events.rst --output-format rst-list
python src/tlo/analysis/hsi_events.py --output-file docs/hsi_events.csv --output-format csv
; Generate parameters listing
python docs/tlo_parameters.py {toxinidir}{/}resources {toxinidir}{/}docs{/}parameters.rst
sphinx-build {posargs:-E} -b html docs dist/docs
-sphinx-build -b linkcheck docs dist/docs
[testenv:check]
deps =
build
docutils
check-manifest
ruff
pylint
; require pytest so pylint can lint tests
pytest
pygments
isort
twine
pyyaml
cffconvert
commands =
python -m build
twine check dist/*.tar.gz dist/*.whl
; ignore that _version.py file generated by setuptools_scm is not tracked by VCS
check-manifest --ignore **/_version.py {toxinidir}
ruff check src tests
isort --check-only --diff src tests
pylint src tests
python {toxinidir}/src/scripts/automation/update_citation.py --check
cffconvert --validate
[testenv:codecov]
deps =
codecov
skip_install = true
commands =
coverage xml --ignore-errors
codecov []
[testenv:report]
deps = coverage[toml]
skip_install = true
commands =
coverage report
coverage html
[testenv:profile]
deps =
-r{toxinidir}/requirements/dev.txt
commands =
python {toxinidir}/src/scripts/profiling/run_profiling.py {posargs}
[testenv:clean]
commands = coverage erase
skip_install = true
deps = coverage
[testenv:citation]
commands = python {toxinidir}/src/scripts/automation/update_citation.py
skip_install = true
deps = pyyaml
[testenv:requirements]
commands =
pip-compile --output-file {toxinidir}/requirements/base.txt
pip-compile --extra dev --output-file {toxinidir}/requirements/dev.txt
skip_install = true
deps = pip-tools
[testenv:markslow]
deps =
-r{toxinidir}/requirements/base.txt
pytest
pytest-json-report
redbaron
commands =
pytest tests --json-report --json-report-file {toxinidir}/test-report.json --json-report-omit collectors log traceback streams warnings
python {toxinidir}/src/scripts/automation/mark_slow_tests.py --json-test-report-path test-report.json