-
Notifications
You must be signed in to change notification settings - Fork 59
/
tox.ini
143 lines (136 loc) · 3.74 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
131
132
133
134
135
136
137
138
139
140
141
142
143
[tox]
min_version = 4.18.1
env_list =
lint
docs
notebooks
doctests
py310
py311-extras-numpy
py312-extras-sbck
py313-extras-lmoments
labels =
static = lint
test = py310, py311-extras-numpy, py312-extras-sbck, py313-extras-lmoments
special = docs, notebooks, doctests
requires =
pip >= 24.2.0
flit >=3.9,<4.0
opts = -vv
[gh]
python =
3.10 = py310-coverage-lmoments
3.11 = py311-coverage-extras-sbck
3.12 = py312-coverage-extras-numpy
# coveralls is not yet supported for py313
3.13 = py313-coverage-extras-lmoments
[testenv:lint]
description = Run code quality compliance tests under {basepython}
skip_install = True
extras =
deps =
codespell ==2.3.0
deptry==0.16.1
flake8 >=7.0.0
flake8-rst-docstrings
black[jupyter]==24.4.2
blackdoc==0.3.9
nbqa
ruff==0.4.10
vulture==2.11
yamllint==1.35.1
commands_pre =
commands =
black --check xclim tests
ruff check xclim tests
flake8 --config=.flake8 xclim tests
vulture xclim tests
nbqa black --check docs
blackdoc --check --exclude=xclim/indices/__init__.py xclim
blackdoc --check docs
codespell xclim tests docs
deptry .
yamllint --config-file=.yamllint.yaml xclim
commands_post =
[testenv:docs]
description = Build the documentation with makefile under {basepython}
setenv =
PYTHONPATH = {toxinidir}
READTHEDOCS = 1
deps =
docs
commands_pre =
commands =
make docs
commands_post =
allowlist_externals =
env
make
# Requires tox-conda compatible with [email protected]
;[testenv:conda]
;description = Run tests with pytest under {basepython} (Anaconda distribution)
;commands_pre =
;conda_channels = conda-forge
;conda_env = environment-dev.yml
;deps =
;extras =
[testenv:notebooks{-prefetch,}]
description = Run notebooks with pytest under {basepython}
extras =
all
deps =
lmoments3
commands =
pytest --no-cov --nbval --dist=loadscope --rootdir=tests/ --ignore=docs/notebooks/example.ipynb docs/notebooks
commands_post =
[testenv:doctests{-prefetch,}]
description = Run doctests with pytest under {basepython}
commands =
python -c 'from xclim.testing.utils import run_doctests; run_doctests()'
commands_post =
[testenv]
description = Run tests with pytest under {basepython}
setenv =
COV_CORE_SOURCE =
PYTEST_ADDOPTS = --numprocesses=logical --durations=10
coverage: PYTEST_ADDOPTS = --numprocesses=logical --durations=10 --cov=xclim --cov-report=term-missing
PYTHONPATH = {toxinidir}
Xfrozen_modules = off
passenv =
CI
CONDA_EXE
COVERALLS_*
GITHUB_*
LD_LIBRARY_PATH
SKIP_NOTEBOOKS
XCLIM_*
extras =
dev
extras: extras
deps =
lmoments: lmoments3
numpy: numpy>=1.23,<2.0
numpy: pint>=0.18,<0.24.0
upstream: -r CI/requirements_upstream.txt
install_command = python -m pip install --no-user {opts} {packages}
download = True
commands_pre =
sbck: python -c 'print("The sbck dependency requires the \"libeigen3-dev\" package to be installed on the system.")'
sbck: python -m pip install pybind11
sbck: python -m pip install sbck
python -m pip list
xclim show_version_info
python -m pip check
xclim --help
prefetch: xclim prefetch_testing_data
commands =
!offline: pytest {posargs}
; Prevent socket connections (except for unix sockets for async support)
offline: python -c 'print("Running offline tests with positional arguments: --disable-socket --allow-unix-socket --m \"not requires_internet\"")'
offline: python -c 'print("These can be overwritten with: tox -e offline -- -m \"some other marker statement\"")'
offline: pytest --disable-socket --allow-unix-socket {posargs:-m 'not requires_internet'}
commands_post =
coverage: - coveralls
allowlist_externals =
git
xclim