forked from BAMresearch/MoDaCor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
162 lines (150 loc) · 3.72 KB
/
tox.ini
File metadata and controls
162 lines (150 loc) · 3.72 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# on updates run 'python3 ci/update.py --no-env' to generate tests.yml github workflows
[testenv:bootstrap]
deps =
jinja2
tox
toml
pyyaml
skip_install = true
commands =
python ci/update.py --no-env
[tox]
envlist =
clean,
build,
check,
docs,
#{py38,py39,py310,py311},
py, # generic Python3 with unspecified version using defaults
report
ignore_basepython_conflict = true
[testenv]
basepython =
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
py311: {env:TOXPYTHON:python3.11}
{bootstrap,clean,build,check,report,docs, py}: {env:TOXPYTHON:python3}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
# fix wrong cp1252 on Windows when loading a notebook with dash (or other unicode symbols)
# since locale.getpreferredencoding can't be changed easily
PYTHONUTF8=1
deps =
pytest
pytest-cov
pytest_notebook
-r{toxinidir}/tests/requirements.txt
usedevelop = false
package = wheel
# https://tox.wiki/en/latest/user_guide.html#packaging
package_env = .pkg
wheel_build_env = .pkg
commands =
pytest --cov-config=tox.ini --cov=src --cov=tests --cov-report=term-missing -vv {posargs}
[testenv:build]
deps = build
skip_install = true
commands = python -m build
[testenv:check]
deps =
check-manifest
flake8
isort
skip_install = true
commands =
check-manifest {toxinidir}
flake8
isort --verbose --check-only --diff --filter-files .
[testenv:docs]
deps =
-r{toxinidir}/docs/requirements.txt
usedevelop = true
commands =
#sphinx-build {posargs:-E} -b doctest docs dist/docs
sphinx-build {posargs:-E} -b html docs dist/docs
# sphinx-build -b linkcheck docs dist/docs
# for GitHub pages
python3 -c 'open("dist/docs/.nojekyll","w")'
[testenv:report]
deps =
coverage
skip_install = true
commands =
coverage report
coverage html
[testenv:clean]
deps =
coverage
skip_install = true
allowlist_externals=/bin/rm,/usr/bin/rm
commands =
coverage erase
rm -Rf dist build htmlcov src/modacor.egg-info
[flake8]
max-line-length = 100
extend-exclude =
.ipynb_checkpoints
per-file-ignores =
# __init__.py:F401 # example
extend-ignore = E203
[pytest]
# If a pytest section is found in one of the possible config files
# (pytest.ini, tox.ini or setup.cfg), then pytest will not look for any others,
# so if you add a pytest config section elsewhere,
# you will need to delete this section from setup.cfg.
norecursedirs =
migrations
minversion = 6.0
python_files =
*.py # for doctests
test_*.py
*_test.py
tests.py
addopts =
-ra
--strict-markers
--doctest-modules
--doctest-glob=\*.rst
--tb=short
--ignore-glob=\*/.ipynb_checkpoints
testpaths =
src
tests
notebooks
# Idea from: https://til.simonwillison.net/pytest/treat-warnings-as-errors
filterwarnings =
ignore::DeprecationWarning:distutils|notebook|_pytest|xarray|nbclient|pytest_notebook|debugpy
ignore::DeprecationWarning:pkg_resources|openpyxl|zmq
# ignore warnings about unknown pytest-notebook options below
ignore::Warning:_pytest
nb_test_files = True
nb_coverage = False
nb_post_processors =
coalesce_streams
nb_diff_ignore =
/metadata/language_info
/cells/*/execution_count
/cells/*/outputs/*/execution_count
/cells/*/outputs/*/data/image/png
#nb_diff_replace =
# '/cells/*/outputs/*/text' '\\' '/'
# configuration for pytest-cov primarily on GitHub runners (hence the paths)
[coverage:paths]
src =
src
*/modacor/modacor/src
tests =
tests
*/modacor/modacor/tests
[coverage:run]
branch = true
source =
src/modacor
tests
parallel = true
[coverage:report]
show_missing = true
precision = 2
omit = *migrations*