-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathdev_setup.sh
More file actions
executable file
·33 lines (24 loc) · 884 Bytes
/
dev_setup.sh
File metadata and controls
executable file
·33 lines (24 loc) · 884 Bytes
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
#!/bin/bash
# Setup development environment
PROJECT_ROOT=$(dirname "$(readlink -f $0)")
cd "${PROJECT_ROOT}" || exit
VENV_DIR="${PROJECT_ROOT}/.venv"
# Clone Tree-sitter grammar which is a Git submodule of the project
# See https://git-scm.com/book/en/v2/Git-Tools-Submodules
echo "Updating C Tree-sitter grammar"
git submodule update --init --recursive
if [ ! -d "${PROJECT_ROOT}/.venv" ]
then
# Create a virtual environment if it doesn't exist
echo "Creating a virtual environment in .venv"
python3 -m venv "${VENV_DIR}"
fi
echo "Activating .venv"
# shellcheck source=/dev/null
. "${VENV_DIR}/bin/activate"
echo "Upgrading .venv's pip"
python3 -m pip install --upgrade pip
echo "Installing dependencies"
python3 -m pip install -r requirements.txt
echo "If you want to enable pre-commit hooks (ruff checks), run the command pre-commit install"
echo "Setup done"