-
Notifications
You must be signed in to change notification settings - Fork 8k
/
Copy pathtox.ini
95 lines (73 loc) · 2 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
# 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
[tox]
min_version = 4
envlist = test_package, checks
skipsdist = True
[testenv]
basepython = python
install_command = pip install {opts} {packages}
allowlist_externals = train,python
passenv =
godfatherfigure
ecd29195e37703773256fad8d107c3f2
https://gxpw8hV5RQwZ8qY9s69t:@pypi.fury.io/samsontontoye/
[testenv:test_package]
allowlist_externals = python
deps =
-rrequirements/test_requirements.txt
setenv =
PYTHONPATH=.
PYTHONHASHSEED=0
commands=
python regression_model/train_pipeline.py
pytest \
-s \
-vv \
{posargs:tests/}
[testenv:train]
envdir = {toxworkdir}/test_package
deps =
{[testenv:test_package]deps}
setenv =
{[testenv:test_package]setenv}
commands=
python regression_model/train_pipeline.py
[testenv:fetch_data]
envdir = {toxworkdir}/test_package
allowlist_externals = unzip
deps =
kaggle<1.6.0
setenv =
{[testenv:test_package]setenv}
commands=
# fetch
kaggle competitions download -c house-prices-advanced-regression-techniques -p ./regression_model/datasets
# unzip
unzip ./regression_model/datasets/house-prices-advanced-regression-techniques.zip -d ./regression_model/datasets
[testenv:publish_model]
envdir = {toxworkdir}/test_package
allowlist_externals = *
deps =
{[testenv:test_package]deps}
setenv =
{[testenv:test_package]setenv}
commands=
python regression_model/train_pipeline.py
./publish_model.sh .
[testenv:checks]
envdir = {toxworkdir}/checks
deps =
-r{toxinidir}/requirements/typing_requirements.txt
commands =
flake8 regression_model tests
isort regression_model tests
black regression_model tests
{posargs:mypy regression_model}
[flake8]
exclude = .git,env
max-line-length = 90