-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_all.sh
More file actions
executable file
·97 lines (74 loc) · 2.09 KB
/
setup_all.sh
File metadata and controls
executable file
·97 lines (74 loc) · 2.09 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
## This script creates Python virtualenv and installs libraries for analysis.
## No deep learning framework will be installed.
##
## The first argument is recognised as the name of virtualenv.
WITH_GIT="yes"
WITH_DVC="yes"
if [[ -z "$1" ]]; then
VENV="venv"
else
VENV=$1
fi
echo "-- Create a Python environment"
python -m venv $VENV
echo "-- Activate the Python environment: $VENV"
source $VENV/bin/activate
echo "-- Upgrade pip"
pip install --upgrade pip
echo "-- Install adhoc and required libraries"
pip install https://github.com/stdiff/adhoc/archive/v0.4.zip
echo "-- Install jupyter lab and jupytext"
pip install jupyter==1.0.0
pip install jupyterlab==2.1.4
pip install jupytext==1.5.0
echo "-- Install jupyterlab_spellchecker"
jupyter labextension install @ijmbarr/jupyterlab_spellchecker
echo "-- Install jupyterlab_templates"
pip install jupyterlab_templates==0.2.4
jupyter labextension install jupyterlab_templates@0.2.4
jupyter serverextension enable --py jupyterlab_templates
#echo "-- Install jupyterlab-emacskeys"
#jupyter labextension install jupyterlab-emacskeys
echo "-- Install further libraries"
pip install watermark==2.0.2
pip install click==7.1.2
##pip install scikit-image==0.16.2 pillow==6.2.2
echo "-- create requirements.txt"
pip freeze > requirements.txt
if [ "$WITH_GIT" == "yes" ]; then
echo "-- initialize git"
git init
cat << EOF > .gitignore
## virtualenv
venv/
## PyCharm
.idea
## Jupyter Notebook Checkpoints
notebooks/.ipynb_checkpoints/
## temporary workspace
tmp/
EOF
echo "Do not forget to add a remote: git remote add origin URL"
git add .gitignore
git add requirements.txt
git commit -m "init"
if [ "$WITH_DVC" == "yes" ]; then
echo "-- install DVC as a Python library"
pip install dvc[s3]
echo "-- initialize DVC"
dvc init --quiet
dvc install
git add .dvc/config
git commit -m "DVC prepared"
echo "Do not forget to add a remote: dvc remote add -d default URL"
fi
fi
echo "-- Deactivate the Python environment"
deactivate
echo "-- Create some directories"
mkdir data
mkdir lib
mkdir notebook
mkdir test
mkdir tmp