forked from sunpy/sunkit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
104 lines (94 loc) · 3.96 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
[tox]
envlist =
py{37,38,39}{,-oldestdeps,-devdeps,-online,-figure}
build_docs
codestyle
requires =
setuptools >= 30.3.0
pip >= 19.3.1
tox-pypi-filter >= 0.12
isolated_build = true
[testenv]
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/master/.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
# sunkit_image 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
setenv =
MPLBACKEND = agg
COLUMNS = 180
PYTEST_COMMAND = pytest -vvv -ra --pyargs sunkit_image --cov-report=xml --cov=sunkit_image --cov-config={toxinidir}/setup.cfg {toxinidir}/docs
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/scikit-image/scikit-image.git
devdeps: git+https://github.com/sunpy/sunpy.git
# Oldest deps we pin against.
oldestdeps: sunpy<2.1
oldestdeps: scikit-image<0.17.0
# These are specific online extras we use to run the online tests.
online: pytest-rerunfailures
online: pytest-timeout
# Figure tests need a tightly controlled environment
figure-!devdeps: astropy==4.0.1.post1
figure-!devdeps: matplotlib==3.3.2
figure-!devdeps: sunpy==2.0.5
# Need cython and numpy until scikit-image 0.19 is out
py39: numpy
# Coverage reporting
pytest-cov
# The following indicates which extras_require from setup.cfg will be installed
# dev is special in that it installs everything
extras =
dev
commands =
!online-!figure: {env:PYTEST_COMMAND} {posargs}
# We have online figure tests we don't want to run.
online: {env:PYTEST_COMMAND} --reruns 2 --timeout=180 --remote-data=any {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 sunkit_image.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/sunkit-image-master/figures/{envname}/ {posargs}
[testenv:build_docs]
changedir = docs
description = Invoke sphinx-build to build the HTML docs
extras = docs
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 --color auto --all-files --show-diff-on-failure