forked from nanograv/PINT
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
160 lines (143 loc) · 3.48 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
158
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist =
clean
ephemeris_connection
oldestdeps
notebooks
docs
report
codestyle
black
singletest
py{38,39,310,311,312,313}-test{,-alldeps,-devdeps}{,-cov}
skip_missing_interpreters = True
[tool:pytest]
# pytest docs seem to say that this section should be called just pytest, not tool:pytest; is it working?
testpaths = tests
addopts =
--cov-report=term-missing
[testenv]
# Make sure the astropy cache is shared with the user's usual.
# Also allow tests that pop up a window to work if possible
passenv =
HOME
DISPLAY
HYPOTHESIS_PROFILE
deps =
pytest
cov: coverage
cov: pytest-cov
cov: pytest-remotedata
pytest-rerunfailures
hypothesis
numdifftools
pathos
setuptools
commands =
pip freeze
!cov: pytest --reruns 5
cov: pytest -v --pyargs tests --cov=pint --cov-config={toxinidir}/.coveragerc {posargs} --reruns 5
cov: coverage xml -o {toxinidir}/coverage.xml
depends =
{py39,py310,py311,py312,313}: clean
report: py39,py310,py312,py313
docs: notebooks
[testenv:singletest]
description =
Try a simple run with a single test
deps =
numpy
numdifftools
astropy
matplotlib
scipy
pytest
coverage
hypothesis<=6.72.0
setuptools
# can change this as needed for a single test run
commands = pytest tests/test_precision.py
[testenv:ephemeris_connection]
description =
Check whether PINT can obtain the DE440 ephemeris (usually from a server)
commands =
python check_ephemeris_connection.py
deps =
setuptools
[testenv:oldestdeps]
description =
Run tests on Python 3 with minimum supported versions of astropy, numpy
basepython = python3.9
deps =
numpy==1.23.0
numdifftools==0.9.39
astropy==5.0.5
matplotlib==3.4.3
scipy==1.9.0
pytest
pytest-rerunfailures
coverage
hypothesis<=6.72.0
commands =
pytest --reruns 5
[testenv:report]
skip_install = true
deps = coverage
commands =
coverage combine
coverage html
coverage report
[testenv:notebooks]
description = update the notebooks
basepython = python3.13
deps =
traitlets
sphinx >= 2.2, != 5.1.0
nbsphinx
sphinx_rtd_theme
pygments
jupyter
numdifftools
nbconvert
pytest
jupytext
black
setuptools
commands =
jupytext --sync examples/*.py
jupytext --pipe black --pipe-fmt py:percent examples/*.ipynb
jupyter nbconvert --execute --inplace examples/*.ipynb
jupytext --sync examples/*.ipynb
[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase
[testenv:docs]
changedir = {toxinidir}/docs
description = invoke sphinx-build to build the HTML docs
basepython = python3.13
deps =
traitlets
sphinx >= 2.2, != 5.1.0
nbsphinx
sphinx_rtd_theme
pygments
jupyter
nbconvert
pytest
jupytext
black
setuptools
commands = sphinx-build -d "{toxworkdir}/docs_doctree" . "{toxworkdir}/docs_out" --color -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
[testenv:black]
skip_install = true
changedir = .
description = use black
deps =
black~=24.0
commands = black --check src tests examples