Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ _GID ?= 10001

VENV := $(shell echo $${VIRTUAL_ENV-.venv})
INSTALL_STAMP = $(VENV)/.install.stamp
DOTENV_FILE = ".env"
POETRY_VIRTUALENVS_IN_PROJECT = true
DOTENV_FILE = .env

.PHONY: help
help:
Expand All @@ -16,6 +15,7 @@ help:
@echo "JBI make rules:"
@echo ""
@echo "Local"
@echo " clean - clean local cache folders"
@echo " format - run formatters (black, isort), fix in place"
@echo " lint - run linters"
@echo " start - run the API service locally"
Expand All @@ -28,10 +28,16 @@ help:
@echo ""
@echo " help - see this text"

.PHONY: clean
clean:
find . -name "__pycache__" | xargs rm -rf
rm -rf .mypy_cache .pytest_cache .coverage .venv


install: $(INSTALL_STAMP)
$(INSTALL_STAMP): poetry.lock
@if [ -z $(shell command -v poetry 2> /dev/null) ]; then echo "Poetry could not be found. See https://python-poetry.org/docs/"; exit 2; fi
poetry install --no-root
POETRY_VIRTUALENVS_IN_PROJECT=1 poetry install --no-root
touch $(INSTALL_STAMP)

.PHONY: build
Expand All @@ -53,7 +59,7 @@ start: $(INSTALL_STAMP) $(DOTENV_FILE)
poetry run python -m src.app.api

$(DOTENV_FILE):
cp -n .env.example $(DOTENV_FILE)
cp .env.example $(DOTENV_FILE)

.PHONY: docker-shell
docker-shell: $(DOTENV_FILE)
Expand Down