-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
102 lines (96 loc) · 3.64 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
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.to
[tox]
envlist = py, py_latest_dependencies, py_backwardscompat, docs, report
isolated_build = True
[testenv:py]
# pytest-cov has an issue when the tests are inside an sdist, as created by tox by default
# despite tests being run, coverage discovers no data, leading to: Coverage.py warning: No data was collected
# this issue is resolved by running pytest-cov within tox development mode, thus not creating an sdist
usedevelop = true
commands =
; Clean up coverage data and run the tests.
; Notebook tests are run in the env with the latest dependencies (see below).
coverage erase
pytest -n 4 --cov --cov-append --cov-report=term-missing tests
deps =
pytest
pytest-cov
pytest-xdist
; NOTE: For some reason including this into setup.py makes things slow locally, fail silently on gitlab
; and lead to non-ending builds (2.5h+) on github. We might want to add it to extra "torch" though (sensai[torch])
pytorch-lightning~=1.1.0
; pin all versions to the lowest tested ones from the requirements files
-rrequirements.txt
-rrequirements_torch.txt
-rrequirements_lightgbm.txt
-rrequirements_geoanalytics.txt
-rrequirements_tensorflow.txt
-rrequirements_xgboost.txt
whitelist_externals =
sh
allowlist_externals =
sh
# This environment tests the latest dependencies
[testenv:py_latest_dependencies]
commands =
pytest
; Run the notebook tests with latest dependencies because the newer library versions have better features
; which some of the notebooks make use of
pytest notebooks
deps =
pytest
; these dependencies are required for notebooks executions (nbclear in the tracking tutorial)
jupyter==1.0.0
nbconvert==6.5.0
clearml==0.17.1
; NOTE: For some reason including this into setup.py makes things slow locally, fail silently on gitlab
; and lead to non-ending builds (2.5h+) on github. This dependency should be installable with pip install sensai[torch] though...
pytorch-lightning>=1.1
; no pinned requirements included, so relaxed versions created by setup.py apply
extras =
full
# Special environment to test backward compatibility of persisted models, where we test with the latest
# dependencies except sklearn, which we must keep at an older version to ensure compatibility
# (because sklearn does break compatibility!)
[testenv:py_backwardscompat]
commands =
; We test only backward compatibility in this environment, so we do not need to run the full test suite
pytest tests/backwardscompat
deps =
pytest
; NOTE: For some reason including this into setup.py makes things slow locally, fail silently on gitlab
; and lead to non-ending builds (2.5h+) on github. This dependency should be installable with pip install sensai[torch] though...
pytorch-lightning>=1.1
; No pinned requirements included except sklearn, so relaxed versions created by setup.py apply.
; We use sklearn version 1.0.2, because it was used to persist the v0.2.0 compatibility test models.
scikit-learn==1.0.2
extras =
torch
[testenv:docs]
commands =
sh build-docs.sh
deps =
sphinx==5.0.2
sphinxcontrib-websupport==1.2.4
sphinx-toolbox==3.7.0
sphinx_rtd_theme
nbsphinx
ipython
ipywidgets
jupyter-book==0.15.1
whitelist_externals =
sh
allowlist_externals =
sh
[testenv:report]
skip_install = true
commands =
coverage html
coverage-badge -o badges/coverage.svg -f
coverage erase
deps =
coverage
coverage-badge