-
Notifications
You must be signed in to change notification settings - Fork 0
/
boostrap
executable file
·42 lines (38 loc) · 1.18 KB
/
boostrap
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
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
"""
"""
if __name__ == "__main__":
import platform
import os
import subprocess
pip_packages = [
'pygit2',
'IPython',
]
os_name = platform.system()
if os_name == 'Windows':
f = open('wt-python/python37._pth')
content = f.readlines()
f.close()
f = open('wt-python/python37._pth', 'w')
f.write("".join(content[0:2]))
f.write('../.wt\n')
f.write("".join(content[2:-1] + ['import site\n']))
f.close()
subprocess.call(
"./wt-python/python -m pip install --no-warn-script-location"
""
"".split() + pip_packages
)
elif not os.path.exists('wt-python'): # Darwin / Linux
subprocess.call(['python', '-m', 'venv', 'wt-python'])
#subprocess.call(['virtualenv', 'wt-python', '--relocatable'])
subprocess.call(
"./wt-python/bin/python -m pip install --no-warn-script-location".split() +
pip_packages
)
if not os.path.exists('wt'):
if os_name in ['Darwin']:
subprocess.call(['ln', '-s', '.wt/wt.py', 'wt'])