forked from microsoft/aurora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_env.sh
executable file
·49 lines (39 loc) · 1.3 KB
/
setup_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
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
venv_name="a_env"
# Function to check for existing virtual environment
check_venv() {
# Check common virtual environment directory names
for venv_dir in "$venv_name"; do
# Check if directory exists and contains key virtualenv files
if [ -d "$venv_dir" ] && [ -f "$venv_dir/pyvenv.cfg" ]; then
echo "Found virtual environment in $venv_dir"
return 0
fi
done
echo "No virtual environment found in current directory"
return 1
}
if ! check_venv; then
echo "Creating virtual environment '$venv_name'..."
python3 -m venv "$venv_name"
if [ $? -eq 0 ]; then
echo "Virtual environment created successfully"
else
echo "Failed to create virtual environment"
exit 1
fi
else
echo "Virtual environment '$venv_name' already exists"
fi
# activate virtual env
source $venv_name/bin/activate
# update and upgrade pip
pip install --upgrade pip
# # install myradar specific requirements from requirements.txt
# pip install -r requirements.txt
# install aurora dev requirements from pyproject.toml
# dev requirements and myradar specific requirements
pip install -e ".[dev, myradar]"
echo ""
echo "Environment setup complete"
echo "Please run 'source $venv_name/bin/activate' to activate the virtual environment."