generated from Hochfrequenz/python_template_repository
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtox.ini
99 lines (89 loc) · 3.03 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
[tox]
envlist =
test
lint
typecheck
formatcheck
spell_check
skip_missing_interpreters = True
[testenv]
commands = python -m pip install --upgrade pip
[testenv:test]
# the test environment is called by the Github action that runs the unit tests
setenv = PYTHONPATH = {toxinidir}/src
deps =
.[test]
commands =
coverage run -m pytest --durations=0 --basetemp={envtmpdir} {posargs}
coverage html --omit .tox/*,unittests/*
coverage report --fail-under 85 --omit .tox/*,unittests/*
[testenv:update_snapshots]
deps =
-r requirements.txt
.[test]
syrupy
setenv = PYTHONPATH = {toxinidir}/src
commands = python -m pytest -m snapshot --basetemp={envtmpdir} {posargs} --snapshot-update
[testenv:lint]
# the lint environment is called by the Github Action that runs the linter
deps =
.[lint]
setenv = PYTHONPATH = {toxinidir}/src
# add your fixtures like e.g. pytest_datafiles here
commands =
pylint kohlrahbi --ignore=version.py
[testenv:spell_check]
# the spellcheck environment checks the code for typos
setenv = PYTHONPATH = {toxinidir}/src
deps =
-r requirements.txt
.[spell_check]
commands =
codespell --ignore-words=domain-specific-terms.txt src
codespell --ignore-words=domain-specific-terms.txt README.md
# add single files (ending with .py) or packages here
[testenv:typecheck]
# the type_check environment checks the type hints using mypy
setenv = PYTHONPATH = {toxinidir}/src
deps =
.[typecheck]
commands =
mypy --show-error-codes src/kohlrahbi --strict
mypy --show-error-codes unittests
[testenv:formatcheck]
deps =
.[formatting]
commands =
black . --check
isort . --check
[testenv:dev]
# the dev environment contains everything you need to start developing on your local machine.
deps =
-r requirements.txt
.[dev]
pip-tools
pre-commit
commands =
pre-commit install
[testenv:update_requirements]
deps =
pip-tools
commands =
pip-compile --upgrade --extra=test --output-file=dev_requirements/requirements-test.txt pyproject.toml
pip-compile --upgrade --extra=lint --output-file=dev_requirements/requirements-lint.txt pyproject.toml
pip-compile --upgrade --extra=typecheck --output-file=dev_requirements/requirements-typecheck.txt pyproject.toml
; dev requirements needs all dependencies
pip-compile --upgrade --all-extras --output-file=dev_requirements/requirements-dev.txt pyproject.toml
; the following requirements are for tooling which does not need the package dependencies from the pyproject.toml.
; they work standalone and are therefore not listed in the pyproject.toml
pip-compile --upgrade --output-file=dev_requirements/requirements-formatcheck.txt dev_requirements/requirements-formatcheck.in
pip-compile --upgrade --output-file=dev_requirements/requirements-test_packaging.txt dev_requirements/requirements-test_packaging.in
; update the lock file
pip-compile --upgrade pyproject.toml
[testenv:test_packaging]
skip_install = true
deps =
.[test_packaging]
commands =
python -m build
twine check dist/*