-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
93 lines (81 loc) · 2.33 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
[tox]
env_list = clean, py311, mypy, black, usort, flake8, docs
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311, mypy, black, usort, flake8, docs
3.12: py312
[flake8]
max-line-length = 119
per-file-ignores =
__init__.py: F401, F403
[coverage:run]
relative_files = true
source =
ramanchada2
tests
[coverage:paths]
source =
src
*/site-packages
[testenv]
deps =
pytest
pytest-cov
change_dir = {toxinidir}
pass_env = COVERAGE_FILE
commands = pytest --cov {posargs}
[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase
[testenv:mypy]
base_python = python3.11
deps = mypy
commands = mypy src tests
[testenv:black]
base_python = python3.11
deps=black
commands =
black \
scripts \
src/ramanchada2/auxiliary/spectra/datasets2/__init__.py \
src/ramanchada2/protocols/calibration/__init__.py \
src/ramanchada2/protocols/metadata_helper.py \
src/ramanchada2/protocols/spectraframe.py \
src/ramanchada2/protocols/twinning.py \
tests/protocols/test_calibrationmodel.py \
tests/protocols/test_metadataextractor.py \
tests/protocols/test_twinning.py
[testenv:usort]
base_python = python3.11
deps=usort
commands =
usort format \
scripts \
src/ramanchada2/auxiliary/spectra/datasets2/__init__.py \
src/ramanchada2/protocols/calibration/calibration_component.py \
src/ramanchada2/protocols/calibration/calibration_model.py \
src/ramanchada2/protocols/calibration/xcalibration.py \
src/ramanchada2/protocols/calibration/ycalibration.py \
src/ramanchada2/protocols/metadata_helper.py \
src/ramanchada2/protocols/spectraframe.py \
src/ramanchada2/protocols/twinning.py \
tests/protocols/test_calibrationmodel.py \
tests/protocols/test_metadataextractor.py \
tests/protocols/test_twinning.py
[testenv:flake8]
base_python = python3.11
deps = flake8
commands = flake8 scripts src tests
[testenv:docs]
base_python = python3.11
deps = pdoc
commands =
python scripts/gen-decorated-docs.py
pdoc ramanchada2 -o {toxinidir}/docs/_build --math --docformat google
[testenv:ipynb]
deps = jupyter
whitelist_externals = bash
commands = bash -c 'for ipynb in {toxinidir}/examples/*.ipynb; do jupyter nbconvert --to python $ipynb --stdout|python; done'