-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_env.sh
executable file
·39 lines (31 loc) · 916 Bytes
/
make_env.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
#!/bin/sh
#
# Make virtualenv for development
#
PYTHON=${PYTHON:-"python3.12"}
if ! [ -x "$(command -v virtualenv)" ]; then
echo "Virtualenv is not installed. Please install virtualenv and try again."
exit 1
fi
if ! [ -x "$(command -v "$PYTHON")" ]; then
echo "$PYTHON is not installed. Please install $PYTHON and try again."
exit 2
fi
if [ ! -d "venv" ]; then
echo "Creating virtualenv..."
virtualenv -p "$PYTHON" venv >/dev/null
if [ $? -ne 0 ]; then
echo "Failed to create virtualenv!"
exit 3
fi
echo "Virtualenv created."
fi
# Activate virtualenv
. venv/bin/activate
# Install dependencies and package in development mode into virtualenv
echo "Installing dependencies and package..."
python -m pip install --upgrade pip >/dev/null 2>&1
python -m pip install -e ".[dev]"
deactivate
echo ""
echo "Run 'source venv/bin/activate' to enter the virtualenv."