forked from Ouranosinc/xclim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
138 lines (131 loc) · 3.55 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
[tox]
min_version = 4.15.1
env_list =
lint
docs
notebooks
offline-prefetch
py39-upstream-doctest
py310-doctest
py311-lmoments
py312-lmoments-doctest
labels =
test = py39, py310-upstream-doctest, py311, notebooks_doctests, offline-prefetch
requires =
pip >= 24.0
flit >=3.9
opts = -vv
[gh]
python =
3.12 = py312-coverage-lmoments-doctest
3.11 = py311-coverage-lmoments-sbck-doctest, offline-coverage-prefetch
3.10 = py310-coverage-lmoments-doctest, notebooks
3.9 = py39-coverage-sbck-doctest, lint, docs
[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
isort==5.13.2
nbqa
ruff==0.4.10
vulture==2.11
yamllint==1.35.1
commands_pre =
commands =
black --check xclim tests
isort --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:offline{-prefetch,}{-coverage,}]
description = Run tests with pytest under {basepython}, preventing socket connections (except for unix sockets for async support)
commands:
python -c 'print("Running offline tests with positional arguments: --disable-socket --allow-unix-socket --m \"not requires_internet\"")'
python -c 'print("These can be overwritten with: tox -e offline -- -m \"some other marker statement\"")'
pytest --disable-socket --allow-unix-socket {posargs:-m 'not requires_internet'}
allowlist_externals =
xclim
[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
deps =
upstream: -r CI/requirements_upstream.txt
sbck: pybind11
lmoments: lmoments3
install_command = python -m pip install --no-user {opts} {packages}
download = True
commands_pre =
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 =
prefetch: xclim prefetch_testing_data
pytest {posargs}
doctest: pytest --rootdir=tests/ --xdoctest xclim
commands_post =
coverage: - coveralls
allowlist_externals =
git
xclim