-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtox.ini
More file actions
158 lines (152 loc) · 5.8 KB
/
Copy pathtox.ini
File metadata and controls
158 lines (152 loc) · 5.8 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
[tox]
min_version = 4.0
requires =
setuptools >= 30.3.0
pip >= 21.0.1
tox-pypi-filter >= 0.14
envlist =
py{311,312,313,314}
py314-devdeps
py311-oldestdeps
codestyle
build_docs{,-notebooks}
py314-{benchmarks,figure}
py314-figure-devdeps
[testenv]
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt
allowlist_externals=
/bin/sh
# Run the tests in a temporary directory to make sure that we don't import
# the package from the source tree
change_dir = .tmp/{envname}
description =
run tests
oldestdeps: with the oldest supported version of key dependencies
devdeps: with the latest developer version of key dependencies
pass_env =
# A variable to tell tests we are on a CI system
CI
# Custom compiler locations (such as ccache)
CC
# Location of locales (needed by sphinx on some systems)
LOCALE_ARCHIVE
# If the user has set a LC override we should follow it
LC_ALL
set_env =
COVERAGE_FILE={toxinidir}/.coverage
MPLBACKEND = agg
COLUMNS = 180
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
COVERAGE_FILE={toxinidir}/.coverage
deps =
# For packages which publish nightly wheels this will pull the latest nightly
devdeps: astropy>=0.0.dev0
devdeps: numpy>=0.0.dev0
devdeps: scipy>=0.0.dev0
devdeps: matplotlib>=0.0.dev0
devdeps: sunpy>=0.0.dev0
devdeps: git+https://github.com/sunpy/ndcube
devdeps: git+https://github.com/spacetelescope/gwcs
devdeps: git+https://github.com/asdf-format/asdf
devdeps: git+https://github.com/astropy/asdf-astropy
devdeps: git+https://github.com/sunpy/mpl-animators
devdeps: git+https://github.com/globus/globus-sdk-python
# Autogenerate oldest dependencies from info in setup.cfg
oldestdeps: minimum_dependencies
figure-!devdeps: matplotlib==3.10.8
figure-!devdeps: mpl-animators==1.2.4
figure-!devdeps: astropy==7.2.0
figure-!devdeps: ndcube==2.4.0
# The following indicates which extras_require will be installed
extras =
tests
commands_pre =
oldestdeps: minimum_dependencies dkist --filename requirements-min.txt
# We need to pin down the pyparsing transitive dependency because of matplotlib
oldestdeps: pip install -r requirements-min.txt pyparsing<3.3
pip freeze --all --no-input
commands =
figure: /bin/sh -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/sh -c "pip freeze >> ./figure_test_images/figure_version_info.txt"
figure: /bin/sh -c "cat ./figure_test_images/figure_version_info.txt"
figure: python -c "import dkist.tests.helpers as h; print(h.get_hash_library_name())"
# To amend the pytest command for different factors you can add a line
# which starts with a factor like `online: --remote-data=any \`
# If you have no factors which require different commands this is all you need:
pytest \
-vvv \
-r fEs \
--pyargs dkist \
--cov-report=xml \
--cov=dkist \
--cov-config={toxinidir}/.coveragerc \
{toxinidir}/docs \
online: --remote-data=any \
!benchmarks: --benchmark-skip \
benchmarks: -m benchmark \
benchmarks: --benchmark-autosave \
figure: -m "mpl_image_compare" \
figure: --mpl \
figure: --remote-data=any \
figure: --mpl-generate-summary=html \
figure: --mpl-baseline-path=https://raw.githubusercontent.com/DKISTDC/dkist-figure-tests/main/figures/{envname}/ \
oldestdeps: -o asdf_schema_tests_enabled=false \
{posargs}
[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
[testenv:build_docs{,-notebooks}]
description = invoke sphinx-build to build the HTML docs
change_dir =
docs
extras =
docs
commands =
pip freeze --all --no-input
sphinx-build \
# Disable parallel here due to https://github.com/astropy/astropy/issues/14916
-j 1 \
--color \
-W \
--keep-going \
-b html \
-d _build/.doctrees \
. \
_build/html \
!notebooks: -D nb_execution_mode=off \
{posargs}
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "html" / "index.html"))'
[testenv:mypy]
description = Run the mypy static type checker
deps = mypy
commands = mypy {toxinidir}/dkist {posargs}
[testenv:dkist-inventory]
description = Run the dkist-inventory tests against this version of dkist
base_python = py313 # dkist-inventory is fussy about python version
extras = # we don't need dkist test extras
allowlist_externals = git, rm, bash
commands_pre =
bash -c 'rm -rf dkist-inventory || true'
git clone https://bitbucket.org/dkistdc/dkist-inventory.git
python -m pip install "./dkist-inventory[test]" {toxinidir}
pip freeze --all --no-input
commands =
python -m pytest dkist-inventory {posargs}
[testenv:dkist-processing-common]
description = Run the dkist-processing-common tests against this version of dkist (requires running rabbitmq and redis servers)
base_python = py313 # dkist-inventory is fussy about python version
extras = # we don't need dkist test extras
allowlist_externals = git, rm, bash
commands_pre =
bash -c 'rm -rf dkist-processing-common || true'
git clone https://bitbucket.org/dkistdc/dkist-processing-common.git
python -m pip install "./dkist-processing-common[test,asdf]" {toxinidir}
pip freeze --all --no-input
commands =
python -m pytest dkist-processing-common -m "not development" {posargs}