forked from sunpy/sunpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
146 lines (138 loc) · 4.68 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
[tox]
envlist =
py{37,38}{,-oldestdeps,-devdeps,-online,-hypothesis,-figure}
build_docs
codestyle
hypothesis
isolated_build = true
[testenv]
pypi_filter = file://.test_package_pins.txt
# We use bash in some of our enviroments so we have to whitelist it.
whitelist_externals=
/bin/bash
/usr/bin/bash
# Run the tests in a temporary directory to make sure that we don't import
# sunpy from the source tree
changedir = .tmp/{envname}
# tox environments are constructued with so-called 'factors' (or terms)
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
# will only take effect if that factor is included in the environment name. To
# see a list of example environments that can be run, along with a description,
# run:
#
# tox -l -v
#
description =
run tests
devdeps: with the latest developer version of key dependencies
oldestdeps: with the oldest supported version of key dependencies
online: that require remote data
hypothesis: using hypothesis (both offline and online)
figure: runs the figure test suite.
setenv =
MPLBACKEND = agg
COLUMNS = 180
PYTEST_COMMAND = pytest -vvv -ra --pyargs sunpy --cov-report= --cov=sunpy --cov-config={toxinidir}/setup.cfg {toxinidir}/docs
devdeps,build_docs,online: HOME = {envtmpdir}
SUNPY_SAMPLEDIR = {env:SUNPY_SAMPLEDIR:{toxinidir}/.tox/{envname}/sample_data/}
passenv =
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
CIRCLECI
deps =
# We need this for some packages.
setuptools
# All our tests run in parallel which this plugin allows us to.
pytest-xdist
# The devdeps factor is intended to be used to install the latest developer version.
# of key dependencies.
devdeps: git+https://github.com/astropy/astropy
devdeps: git+https://github.com/matplotlib/matplotlib
# Oldest deps we pin against.
oldestdeps: astropy<4.1
oldestdeps: numpy<1.17.0
oldestdeps: matplotlib<3.0
oldestdeps: scipy<1.3
# These are specific online extras we use to run the online tests.
online: pytest-rerunfailures
online: pytest-timeout
online: astroquery
hypothesis: astroquery
# The 32bit build needs numpy installed before trying to install sunpy due
# to https://github.com/scikit-image/scikit-image/issues/4261
32bit: numpy
32bit: cryptography<3.0
# Figure tests need a tightly controlled environment
figure-!devdeps: astropy==4.0.1.post1
figure-!devdeps: matplotlib==3.2.1
# The following indicates which extras_require from setup.cfg will be installed
# dev is special in that it installs everything
extras =
dev
commands =
!online-!hypothesis-!figure: {env:PYTEST_COMMAND} {posargs}
online: {env:PYTEST_COMMAND} --reruns 2 --timeout=180 --remote-data=any -m "remote_data" {posargs}
devdeps-!figure: bash -ec "for f in {toxinidir}/examples/*/*.py; do [[ $f == *skip* ]] && continue; echo "$f" && python "$f"; done"
hypothesis: {env:PYTEST_COMMAND} --hypothesis-show-statistics --remote-data=any -m "hypothesis" {posargs}
figure: /bin/bash -c "mkdir -p ./figure_test_images; python -c 'import matplotlib as mpl; print(mpl.ft2font.__file__, mpl.ft2font.__freetype_version__, mpl.ft2font.__freetype_build_type__)' > ./figure_test_images/figure_version_info.txt"
figure: /bin/bash -c "pip freeze >> ./figure_test_images/figure_version_info.txt"
figure: /bin/bash -c "cat ./figure_test_images/figure_version_info.txt"
figure: {env:PYTEST_COMMAND} -m "figure" {posargs}
[testenv:build_docs]
changedir = docs
description = Invoke sphinx-build to build the HTML docs
extras = dev
commands =
sphinx-build --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))'
[testenv:codestyle]
pypi_filter =
skip_install = true
description = Run all style and file checks with pre-commit
deps =
pre-commit
commands =
pre-commit install-hooks
pre-commit run --verbose --all-files --show-diff-on-failure
# This env requires tox-conda.
[testenv:py38-conda]
pypi_filter =
basepython = python3.8
extras =
deps =
conda_deps =
asdf
astropy
beautifulsoup4
conda
dask
drms
extension-helpers
glymur
hypothesis
jinja2
libopenblas
lxml
matplotlib
numpy
openjpeg
pandas
parfive
pytest
pytest-astropy
pytest-cov
pytest-mock
pytest-xdist
scikit-image
scipy
sphinx
sqlalchemy
towncrier
zeep
pillow
conda_channels = conda-forge
install_command = pip install --no-deps {opts} {packages}
commands =
conda list
{env:PYTEST_COMMAND} {posargs}