-
Notifications
You must be signed in to change notification settings - Fork 168
/
tox.ini
130 lines (115 loc) · 3.37 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
# Tox configuration file for pysteps projects
# Need conda, tox and tox-conda installed to run
#
# In conda run:
# > conda install -c conda-forge tox tox-conda
#
# Alternatively, you can install them using pip:
# > pip install tox tox-conda
#
# Then, to run the tests, from the repo’s root run:
#
# > tox # Run pytests
# > tox -e install # Test package installation
# > tox -e black # Test for black formatting warnings
[tox]
envlist = py37, py38, py39
[testenv]
description = Run the pysteps's test suite
deps =
-r{toxinidir}/requirements.txt
cython
dask
toolz
pillow
pyfftw
h5py
PyWavelets
gitpython
pytest
pytest-cov
codecov
conda_deps =
netCDF4
pyproj
cartopy
pygrib
rasterio
conda_channels = conda-forge
setenv =
PYSTEPS_DATA_PATH = {toxworkdir}/pysteps-data
PYSTEPSRC = {toxworkdir}/pysteps-data/pystepsrc
PACKAGE_ROOT = {toxinidir}
PROJ_LIB={envdir}/share/proj
commands =
python {toxinidir}/ci/fetch_pysteps_data.py
pytest --pyargs pysteps --cov=pysteps -ra --disable-warnings
[test_no_cov]
commands =
python {toxinidir}/ci/fetch_pysteps_data.py
pytest --pyargs pysteps --disable-warnings
[testenv:install]
description = Test the installation of the package in a clean environment and run minimal tests
deps = pytest
conda_deps =
changedir = {homedir}
commands =
pip install -U {toxinidir}/
python -c "import pysteps"
# Test the pysteps plugin support
pip install cookiecutter
cookiecutter -f --no-input https://github.com/pySTEPS/cookiecutter-pysteps-plugin -o {temp_dir}/
pip install {temp_dir}/pysteps-importer-abc
python {toxinidir}/ci/test_plugin_support.py
# Check the compiled modules
python -c "from pysteps import motion"
python -c "from pysteps.motion import vet"
python -c "from pysteps.motion import proesmans"
[testenv:install_full]
description = Test the installation of the package in an environment with all the dependencies
changedir = {homedir}
commands =
{[testenv:install]commands}
{[test_no_cov]commands}
[testenv:pypi]
description = Test the installation of the package from the PyPI in a clean environment
deps = pytest
conda_deps =
changedir = {homedir}
commands =
pip install --no-cache-dir pysteps
python -c "import pysteps"
{[test_no_cov]commands}
[testenv:pypi_test]
description = Test the installation of the package from the test-PyPI in a clean environment
deps = pytest
conda_deps =
changedir = {homedir}
commands =
pip install --no-cache-dir --index-url https://test.pypi.org/simple/ --extra-index-url=https://pypi.org/simple/ pysteps
python -c "import pysteps"
{[test_no_cov]commands}
[testenv:pypi_test_full]
description = Test the installation of the package from the test-PyPI in an environment with all the dependencies
changedir = {homedir}
commands = {[testenv:pypi_test]commands}
[testenv:docs]
description = Build the html documentation using sphinx
usedevelop = True
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
cython
conda_channels =
conda-forge
default
changedir = doc
setenv =
PYSTEPS_DATA_PATH = {toxworkdir}/pysteps-data
PYSTEPSRC = {toxworkdir}/pysteps-data/pystepsrc
commands =
python {toxinidir}/ci/fetch_pysteps_data.py
sphinx-build -b html source _build
[testenv:black]
deps = black
commands = black --check pysteps