forked from ccnmtl/dmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.py
executable file
·39 lines (29 loc) · 1.18 KB
/
bootstrap.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
#!/usr/bin/env python
import os
import sys
import subprocess
import shutil
pwd = os.path.abspath(os.path.dirname(__file__))
vedir = os.path.abspath(os.path.join(pwd,"ve"))
if os.path.exists(vedir):
shutil.rmtree(vedir)
virtualenv_support_dir = os.path.abspath(os.path.join(pwd, "requirements", "virtualenv_support"))
ret = subprocess.call(["python", "virtualenv.py",
"--extra-search-dir=%s" % virtualenv_support_dir,
"--never-download",
vedir])
if ret: exit(ret)
ret = subprocess.call(
[os.path.join(vedir, 'bin', 'pip'), "install",
"--index-url=http://pypi.ccnmtl.columbia.edu/",
"wheel==0.21.0"])
if ret:
exit(ret)
ret = subprocess.call([os.path.join(vedir, 'bin', 'pip'), "install",
"--use-wheel",
"--index-url=http://pypi.ccnmtl.columbia.edu/",
"--requirement",os.path.join(pwd,"requirements.txt")])
if ret: exit(ret)
ret = subprocess.call(["python","virtualenv.py","--relocatable",vedir])
# --relocatable always complains about activate.csh, which we don't really
# care about. but it means we need to ignore its error messages