From 029b430f49de901cd7a41af62d0d7365871e170d Mon Sep 17 00:00:00 2001 From: Kun <1amb4a@gmail.com> Date: Sun, 17 Sep 2023 10:16:59 +0900 Subject: [PATCH] chore: Update .envrc.template, Makefile --- .envrc.template | 28 ---------------------------- Makefile | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/.envrc.template b/.envrc.template index 2238f5e..50dac1d 100644 --- a/.envrc.template +++ b/.envrc.template @@ -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 "" diff --git a/Makefile b/Makefile index f61b107..1615c7d 100644 --- a/Makefile +++ b/Makefile @@ -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 ""