/
tox.ini
71 lines (50 loc) 路 1.34 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
# Tox is a generic virtualenv management and test command line tool. Its goal is to
# standardize testing in Python. We will be using it extensively in this course.
# Using Tox we can (on multiple operating systems):
# + Eliminate PYTHONPATH challenges when running scripts/tests
# + Eliminate virtualenv setup confusion
# + Streamline steps such as model training, model publishing
[pytest]
log_cli_level=WARNING
[tox]
envlist = test_app, typechecks, lint, stylechecks
skipsdist = True
[testenv]
install_command = pip install {opts} {packages}
passenv =
PIP_EXTRA_INDEX_URL
[testenv:test_app]
deps =
-rtest_requirements.txt
setenv =
PYTHONPATH=.
PYTHONHASHSEED=0
commands=
pytest -vv {posargs:tests/}
[testenv:run]
envdir = {toxworkdir}/test_app
deps = {[testenv:test_app]deps}
setenv = {[testenv:test_app]setenv}
commands =
python app/main.py
[testenv:typechecks]
envdir = {toxworkdir}/test_app
deps = {[testenv:test_app]deps}
commands =
{posargs:mypy app}
[testenv:stylechecks]
envdir = {toxworkdir}/test_app
deps = {[testenv:test_app]deps}
commands =
{posargs:flake8 app}
[testenv:lint]
envdir = {toxworkdir}/test_app
deps = {[testenv:test_app]deps}
commands =
isort app
black app
mypy app
flake8 app
[flake8]
exclude = .git, __pycache__, __init__.py, .mypy_cache, .pytest_cache, .venv, alembic
max-line-length = 88