forked from AI21Labs/ai21-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·38 lines (28 loc) · 787 Bytes
/
init.sh
File metadata and controls
executable file
·38 lines (28 loc) · 787 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
34
35
36
37
38
#!/bin/bash
cd "$(dirname "$0")" || exit
# create .git folder
if [[ ! -d .git ]]; then
git init
fi
# install the python version specified in .python-version, if not already installed
if pyenv --version; then
pyenv install --skip-existing
fi
# install poetry if not already installed
if ! poetry --version; then
brew install poetry
fi
# poetry needs to create the venv with the same python version
poetry env use "$(cat .python-version)"
# update lock file
poetry lock --no-update
# install dependencies
poetry install
# install pre-commit if not already installed
if ! pre-commit --version; then
brew install pre-commit
fi
# install pre-commit hooks
pre-commit install --install-hooks -t pre-commit -t commit-msg
# shellcheck source=/dev/null
source .venv/bin/activate