Skip to content

Commit

Permalink
chore: Update .envrc.template, Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
1ambda committed Sep 17, 2023
1 parent 4595f4f commit 029b430
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
28 changes: 0 additions & 28 deletions .envrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,11 @@ pvenv=lakehouse

TAG="direnv"

if ! [ -x "$(command -v pyenv)" ]; then
echo -e "${TAG} Installing brew CLI: pyenv, virtualenv"
brew install pyenv
brew install pyenv-virtualenv
fi

if pyenv versions | grep -q ${pyversion}; then
echo -e ""
echo -e "${TAG} Skip installing python ${pyversion}"
echo -e ""
else
echo -e ""
echo -e "${TAG} Installing pyenv python ${pyversion}"
echo -e ""
pyenv install ${pyversion}
fi

# Activate Environment
echo -e "${TAG} Activating pyenv virtualenv ${pvenv}"
use python ${pyversion}
layout virtualenv ${pyversion} ${pvenv}
layout activate ${pvenv}
if ! [ -x "$(command -v poetry)" ]; then
pip3 install poetry
pip install --upgrade pip
fi

# Install Dependencies
echo -e "${TAG} Installing poetry dependencies"
poetry install

echo -e "${TAG} Installing pre-commit dependencies"
pre-commit install

# Start
echo -e ""
Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,25 @@ compose.clean:
@ echo ""
@ echo ""

.PHONY:prepare
prepare:
@ echo ""
@ echo ""
@ echo "[$(TAG)] ($(shell date '+%H:%M:%S')) - Prepare local environment"
@ brew install pyenv pyenv-virtualenv
@ pip3 install poetry
@ pip3 install --upgrade pip
@ poetry install
@ pre-commit install
@ pre-commit run
@ echo ""
@ echo ""

.PHONY:test
test:
@ echo ""
@ echo ""
@ echo "[$(TAG)] ($(shell date '+%H:%M:%S')) - Executing pytest"
@ echo "[$(TAG)] ($(shell date '+%H:%M:%S')) - Executing tests"
@ AIRFLOW_HOME=$(shell pwd) poetry run pytest dags-test/
@ echo ""
@ echo ""
Expand Down

0 comments on commit 029b430

Please sign in to comment.