-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtox.ini
153 lines (141 loc) · 3.36 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
144
145
146
147
148
149
150
151
152
153
# 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
deps =
-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/mcsas3.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|pkg_resources
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
*/mcsas3/mcsas3/src
tests =
tests
*/mcsas3/mcsas3/tests
[coverage:run]
branch = true
source =
src/mcsas3
tests
parallel = true
[coverage:report]
show_missing = true
precision = 2
omit = *migrations*