-
Notifications
You must be signed in to change notification settings - Fork 50
/
tox.ini
107 lines (101 loc) · 2.9 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
[tox]
min_version = 4.0
env_list =
black
docs
notebooks_doctests{-coverage,}
; opt-slow
py38-lm3
py39-upstream-doctest
py310-slow
requires =
pip >= 21.0
opts = -v
[testenv:black]
description = Run code quality compliance tests under {basepython}
skip_install = True
extras =
deps =
flake8
flake8-rst-docstrings
black[jupyter]
blackdoc
isort
nbqa
pydocstyle
yamllint
commands =
pydocstyle --config=setup.cfg xclim
flake8 --config=setup.cfg xclim
black --check xclim
nbqa black --check docs
blackdoc --check --exclude=xclim/indices/__init__.py xclim
blackdoc --check docs
isort --check xclim
yamllint --config-file=.yamllint.yaml xclim
commands_post =
[testenv:docs]
description = Build the documentation with makefile under {basepython}
setenv =
!notebooks: SKIP_NOTEBOOKS = 1
PYTHONPATH = {toxinidir}
READTHEDOCS = 1
commands =
make docs
commands_post =
allowlist_externals =
env
make
# Requires tox-conda compatible with tox@v4.0
;[testenv:conda]
;description = Run tests with pytest under {basepython} (Anaconda distribution)
;conda_channels = conda-forge
;conda_env = environment-dev.yml
;extras =
[testenv:notebooks_doctests{-coverage,}]
description = Run notebooks and doctests with pytest under {basepython}
commands =
pytest --no-cov --nbval --dist=loadscope docs/notebooks --ignore=docs/notebooks/example.ipynb
pytest --rootdir xclim/testing/tests/ --xdoctest xclim --ignore=xclim/testing/tests/
# Requires tox-conda compatible with tox@v4.0
;[testenv:opt-{slow,not_slow}]
;description = Run tests with optional requirements (SBCK (experimental), eofs) and pytest under {basepython} (Anaconda distribution)
;conda_env = environment-dev.yml
;commands_pre =
; python -m pip install --no-user "git+https://github.com/Ouranosinc/SBCK.git@easier-install#egg=sbck&subdirectory=python"
;commands =
; pip check
; !slow: pytest xclim -m "not slow" --durations=10
; slow: pytest xclim --durations=10
[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}
passenv =
CI
CONDA_EXE
COVERALLS_*
GITHUB_*
LD_LIBRARY_PATH
XCLIM_*
extras = dev
deps =
coverage: coveralls
lm3: git+https://github.com/OpenHydrology/lmoments3.git@develop#egg=lmoments3
upstream: -rrequirements_upstream.txt
install_command = python -m pip install --no-user {opts} {packages}
download = True
commands_pre =
pip list
pip check
commands =
doctest: pytest --no-cov --rootdir xclim/testing/tests/ --xdoctest xclim --ignore=xclim/testing/tests/
!slow: pytest xclim -m "not slow"
slow: pytest xclim
commands_post =
coverage: - coveralls
allowlist_externals =
git