-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_linux.sh
executable file
·55 lines (46 loc) · 1.11 KB
/
setup_linux.sh
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
function check_virtualenv {
python -c "import virtualenv"
if [ $? -ne 0 ]; then
sudo pip install virtualenv
fi
return $status
}
function install_non_python_dep {
if [[ "$1" != "Darwin" && "$NO_DISPLAY" != "True" ]]; then
sudo apt-get install -y -qq scrot python3-tk python3-dev
fi
}
function generate_req {
echo "$1" >> requirements.txt
}
function generate_requirements {
if [[ "$NO_DISPLAY" != "True" ]]; then
generate_req "pyautogui"
generate_req "pywinauto"
generate_req "wxPython"
if [[ "$1" == "Darwin" ]]; then
generate_req "pyobjc-core"
generate_req "pyobjc"
else
generate_req "python3-xlib"
fi
fi
generate_req "pytest"
generate_req "pytest-mock"
generate_req "pytest-cov"
generate_req "numpy"
generate_req "psutil"
generate_req "opencv-python"
generate_req "pyinstaller"
}
os_name=$(uname)
echo "" > requirements.txt
check_virtualenv
virtualenv -p python3 .
source bin/activate
install_non_python_dep $os_name
pip install --upgrade pip
generate_requirements $os_name
pip install -r requirements.txt
# python-bioformats must be installed after numpy
pip install python-bioformats