-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
81 lines (71 loc) · 2.27 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
;
; tox - automated and standardized testing in Python
; https://tox.wiki/en/latest/user_guide.html
;
; install multiple Python environments using pyenv
; ------------------------------------------------
;
; install pyenv itself
; curl https://pyenv.run | bash
; ...and follow the provided instructions
; install build dependencies
; https://github.com/pyenv/pyenv/wiki#suggested-build-environment
; install Python versions
; pyenv install 3.9
; pyenv install 3.10
; pyenv install 3.11
; install tox & virtualenv-penv
; pipx install tox
; pipx inject tox virtualenv-pyenv
;
; optimize Python performance:
; https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-for-maximum-performance
[tox]
requires =
tox >=4
env_list =
lint
type
py{310,311,312}
; pytest & coverage
; https://pytest-cov.readthedocs.io/en/latest/tox.html
[coverage:run]
branch = True
[coverage:report]
fail_under = 90
[coverage:html]
directory = tests/coverage_report/
; https://github.com/PyCQA/flake8
[flake8]
max-line-length = 250
extend-ignore = E221,E241
[testenv:lint]
description = lint code (flake8)
deps =
--global-option="$(python-config --includes)" -r requirements.txt
--global-option="$(python-config --includes)" -r requirements-dev.txt
commands =
flake8 {posargs:feeph examples/ tests/}
[testenv:type]
description = check type hints
deps =
--global-option="$(python-config --includes)" -r requirements.txt
--global-option="$(python-config --includes)" -r requirements-dev.txt
commands =
mypy -p feeph.emc2101
mypy {posargs:examples/ tests/}
; code is incompatible with Python 3.9 due to type hints
; (it could be fixed by changing the type hints but we won't)
[testenv]
description = install pytest in a virtual environment and invoke it on the tests folder
set_env =
VIRTUALENV_DISCOVERY = pyenv
deps =
--global-option="$(python-config --includes)" -r requirements.txt
--global-option="$(python-config --includes)" -r requirements-dev.txt
# do not generate a coverage report from tox
# if we would the files would be relative to the tox virtual environments
# and prefixed with '.tox/py*/lib/python*/site-packages/' - which makes
# them interesting to look at but useless for consumption by other tools
commands =
pytest --no-cov {posargs: tests/}