Skip to content

Commit

Permalink
Update bootstrap/py_bootstrap.sh
Browse files Browse the repository at this point in the history
Co-authored-by: Márton Szász <szaszm@apache.org>
  • Loading branch information
martinzink and szaszm authored Mar 12, 2024
1 parent 9218800 commit 664107b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions bootstrap/py_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ if ! command -v python3 &>/dev/null; then
exit 1
fi

# Check if virtualenv is installed
if ! command -v python3 -m venv --help &>/dev/null; then
echo "virtualenv is not installed"
exit 1
fi

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
VENV_DIR="$SCRIPT_DIR/venv"

set -e

if [ -d "$VENV_DIR" ]; then
source "$VENV_DIR/bin/activate"
else
echo "Creating virtualenv"
python3 -m venv "$VENV_DIR"
if ! python3 -m venv "$VENV_DIR"; then
echo "Creating virtualenv failed. Is venv installed?"
exit 1
fi
source "$VENV_DIR/bin/activate"
pip install -r "$SCRIPT_DIR/requirements.txt"
fi
Expand Down

0 comments on commit 664107b

Please sign in to comment.