-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
88 lines (77 loc) · 2.04 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
[tox]
envlist =
tests
linting
type_check
format
dev
test_packaging
skip_missing_interpreters = True
skipsdist = True
[testenv]
commands = python -m pip install --upgrade pip
[testenv:tests]
# the tests environment is called by the Github action that runs the unit tests
deps =
-r requirements.txt
.[tests]
setenv = PYTHONPATH = {toxinidir}/src
commands = python -m pytest --basetemp={envtmpdir} {posargs}
[testenv:linting]
# the linting environment runs pylint on the code base
deps =
-r requirements.txt
.[linting]
setenv = PYTHONPATH = {toxinidir}/src
commands =
pylint bdew_datetimes
[testenv:type_check]
# the type_check environment checks the type hints using mypy
deps =
-r requirements.txt
.[type_check]
setenv = PYTHONPATH = {toxinidir}/src
commands =
mypy --show-error-codes src/bdew_datetimes
mypy --show-error-codes tests
[testenv:format]
# install isort and black and invoke them on the current folder
deps =
.[formatting]
commands =
isort .
black .
[testenv:dev]
# the dev environment allow upgrading the requirements.txt via pip-compile
# a recent requirements.in is required!
deps =
{[testenv:tests]deps}
{[testenv:linting]deps}
{[testenv:type_check]deps}
{[testenv:format]deps}
pip-tools
commands =
python -m pip install --upgrade pip
pip install -r requirements.txt
[testenv:test_packaging]
skip_install = true
deps =
.[packaging]
commands =
python -m build
twine check dist/*
[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/bdew_datetimes
codespell --ignore-words=domain-specific-terms.txt README.md
# add single files (ending with .py) or packages here
# note that domain-specific-terms.txt (the ignore list of the spell checker) has to contain the ignored words in all lower case
[testenv:deps]
base_python=py38
deps =
pip-tools