-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
43 lines (31 loc) · 1.18 KB
/
setup.py
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
"""Setup script for ml-project"""
import sys
import subprocess
from os.path import normpath
def setup():
"""Setup function
Requires:
Installation of `miniconda`_.
Todo:
* Include automatic installtion of miniconda.
.. _miniconda:
https://conda.io/docs/install/quick.html#linux-miniconda-install
"""
if sys.version_info.major < 3:
action = getattr(subprocess, "call")
elif sys.version_info.minor < 5:
action = getattr(subprocess, "call")
else:
action = getattr(subprocess, "run")
action(["conda", "env", "create", "-n", "ml_project", "-f",
".environment"])
action(["bash", "-c", "source activate ml_project && "
"smt init -d {datapath} -i {datapath} -e python -m run.py "
"-c error -l cmdline ml_project".format(
datapath=normpath('./data'))])
action(["cp", ".example_config.yaml", ".config.yaml"])
print("\n========================================================")
print("Type 'source activate ml_project' to activate environment.")
print("==========================================================")
if __name__ == '__main__':
setup()