forked from sunpy/sunpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
162 lines (153 loc) · 5.5 KB
/
tox.ini
File metadata and controls
162 lines (153 loc) · 5.5 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
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
159
160
161
162
[tox]
envlist =
py{37,38,39}{,-oldestdeps,-devdeps,-online,-figure}
build_docs
codestyle
isolated_build = true
[testenv]
pypi_filter = file://.test_package_pins.txt
# We use bash in some of our environments 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 constructed 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 (as well as the offline ones)
hypothesis: using hypothesis (both offline and online)
figure: runs the figure test suite.
setenv =
MPLBACKEND = agg
SUNPY_SAMPLEDIR = {env:SUNPY_SAMPLEDIR:{toxinidir}/.tox/{envname}/sample_data/}
PYTEST_COMMAND = pytest -vvv -s -raR --pyargs sunpy --cov-report=xml --cov=sunpy --cov-config={toxinidir}/setup.cfg {toxinidir}/docs
devdeps,build_docs,online: HOME = {envtmpdir}
build_docs: HIDE_PARFIVE_PROGESS = True
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
# Since xdist uses stdout in order for it to work, we have to bypass this and use to
# capture any logging we might put in a test for debugging.
pytest-logger
# 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.2
oldestdeps: scipy<1.3
oldestdeps: parfive<1.2
oldestdeps: pandas<0.25
oldestdeps: parfive<1.2
oldestdeps: drms<0.7
oldestdeps: h5netcdf<0.9
# These are specific online extras we use to run the online tests.
online: pytest-rerunfailures
online: pytest-timeout
online: astroquery
hypothesis: astroquery
# The 32bit and py39 build needs numpy installed before trying to install sunpy due
# to https://github.com/scikit-image/scikit-image/issues/4261
32bit,py39: numpy
# We have to pin this to use a wheel for manylinux2010 to compile
32bit: cryptography<3.0
# Figure tests need a tightly controlled environment
figure-!devdeps: astropy==4.0.3
figure-!devdeps: matplotlib==3.3.2
build_docs: git+https://github.com/Cadair/sphinx-gallery@skip_on_fail#egg=sphinx-gallery
# The following indicates which extras_require from setup.cfg will be installed
# We use test and all so we don't install docs when we don't need it (as
# opposed to dev).
extras =
all
tests
commands =
!online-!hypothesis-!figure: {env:PYTEST_COMMAND} {posargs}
online: {env:PYTEST_COMMAND} --hypothesis-show-statistics --reruns 2 --reruns-delay 15 --timeout=180 --remote-data=any {posargs}
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: python -c "import sunpy.tests.helpers as h; print(h.get_hash_library_name())"
figure: {env:PYTEST_COMMAND} -m "mpl_image_compare" --mpl --remote-data=any --mpl-generate-summary=html --mpl-baseline-path=https://raw.githubusercontent.com/sunpy/sunpy-figure-tests/sunpy-master/figures/{envname}/ {posargs}
[testenv:build_docs]
changedir = docs
description = Invoke sphinx-build to build the HTML docs
# Be verbose about the extras rather than using dev for clarity
extras =
all
docs
commands =
sphinx-build -j auto --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 --color always --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
h5netcdf
jinja2
libopenblas>=0.3.12
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}