File: tox.ini

package info (click to toggle)
ndcube 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,356 kB
  • sloc: python: 9,335; makefile: 34
file content (129 lines) | stat: -rw-r--r-- 4,901 bytes parent folder | download
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
[tox]
min_version = 4.0
requires =
    tox-pypi-filter>=0.14
envlist =
    py{311,312,313,314}
    py313-minimal
    py314-devdeps
    py311-oldestdeps
    codestyle
    build_docs
    asdf_schemas

[testenv]
# We use bash in some of our environments so we have to whitelist it.
allowlist_externals=
    /bin/bash
    /usr/bin/bash
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt
# 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
    online: that require remote data (as well as the offline ones)
    figure: runs the figure test suite.
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 =
    MPLBACKEND = agg
    COLUMNS = 180
    PYTEST_COMMAND = pytest -vvv -r fEs --pyargs ndcube --cov-report=xml --cov=ndcube --cov-config={toxinidir}/.coveragerc {toxinidir}/docs
    PARFIVE_HIDE_PROGESS = True
    devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
deps =
    # The devdeps factor is intended to be used to install the latest developer version.
    # of key dependencies.
    # Astropy is installed from the nightly wheels
    devdeps: astropy>=0.0dev0
    devdeps: matplotlib>=0.0dev0
    devdeps: git+https://github.com/sunpy/sunpy
    devdeps: git+https://github.com/sunpy/mpl-animators
    devdeps: git+https://github.com/spacetelescope/gwcs
    devdeps: numpy>=0.0.dev0
    # These are specific online extras we use to run the online tests.
    online: pytest-rerunfailures
    online: pytest-timeout
    # Oldest Dependencies
    oldestdeps: minimum_dependencies
    # Figure tests need a tightly controlled environment
    figure-!devdeps: astropy==7.1.0
    figure-!devdeps: dask
    figure-!devdeps: matplotlib==3.10.0
    figure-!devdeps: mpl-animators==1.2.4
    figure-!devdeps: scipy
# The following indicates which extras_require will be installed
extras =
    minimal: tests-minimal
    !minimal: tests
commands_pre =
    oldestdeps: minimum_dependencies ndcube --extras plotting reproject asdf tests-optional --filename requirements-min.txt
    # Pin down pyparsing because of incompatibility with old mpl
    oldestdeps: pip install -r requirements-min.txt pyparsing<3.3
    oldestdeps: python -c "import astropy.time; astropy.time.update_leap_seconds()"
    pip freeze --all --no-input
commands =
    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 ndcube.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 ndcube \
    --cov-report=xml \
    --cov=ndcube \
    --cov-config={toxinidir}/.coveragerc \
    online: --remote-data=any \
    figure: -m "mpl_image_compare" \
    figure: --mpl \
    figure: --remote-data=any \
    figure: --mpl-generate-summary=html \
    figure: --mpl-baseline-path=https://raw.githubusercontent.com/sunpy/sunpy-figure-tests/ndcube-main/figures/{envname}/ \
    {toxinidir}/docs \
    {posargs}

[testenv:asdf_schemas]
description = Run schema tests
deps =
    pytest
    asdf
set_env =
    asdf_schema_root = {toxinidir}/ndcube/asdf/resources
commands =
    pytest {env:asdf_schema_root}

[testenv:build_docs]
change_dir = docs
description = Invoke sphinx-build to build the HTML docs
extras =
    plotting
    reproject
    docs
commands =
    pip freeze --all --no-input
    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 always --all-files --show-diff-on-failure