forked from ccnmtl/diabeaters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.py
executable file
·40 lines (32 loc) · 1.24 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
38
39
40
#!/usr/bin/env python
import glob
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",
"-E", vedir,
"--enable-site-packages",
"--index-url=''",
"--requirement",os.path.join(pwd,"requirements/apps.txt")])
if ret: exit(ret)
def has_eggs():
return [os.path.basename(path) for path in
glob.glob(os.path.join(pwd, "requirements", "eggs", "*.egg"))]
if has_eggs():
# only try to easy install eggs if there actually are some
cmd = ([os.path.join(vedir,"bin/easy_install"),
'-f', os.path.join(pwd,"requirements/eggs/")] +
has_eggs())
ret = subprocess.call(cmd)
exit(ret)