weekev/babylon-chat
0
1ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))2APP_NAME:=gpt4all_api3PYTHON:=python3.84SHELL := /bin/bash5 6all: dependencies7 8fresh: clean dependencies9 10testenv: clean_testenv test_build11 docker compose -f docker-compose.yaml up --build12 13testenv_gpu: clean_testenv test_build14 docker compose -f docker-compose.yaml -f docker-compose.gpu.yaml up --build15 16testenv_d: clean_testenv test_build17 docker compose up --build -d18 19test:20 docker compose exec $(APP_NAME) pytest -svv --disable-warnings -p no:cacheprovider /app/tests21 22test_build:23 DOCKER_BUILDKIT=1 docker build -t $(APP_NAME) --progress plain -f $(APP_NAME)/Dockerfile.buildkit .24 25clean_testenv:26 docker compose down -v27 28fresh_testenv: clean_testenv testenv29 30venv:31 if [ ! -d $(ROOT_DIR)/env ]; then $(PYTHON) -m venv $(ROOT_DIR)/env; fi32 33dependencies: venv34 source $(ROOT_DIR)/env/bin/activate; $(PYTHON) -m pip install -r $(ROOT_DIR)/$(APP_NAME)/requirements.txt35 36clean: clean_testenv37 # Remove existing environment38 rm -rf $(ROOT_DIR)/env;39 rm -rf $(ROOT_DIR)/$(APP_NAME)/*.pyc;40 41 42black:43 source $(ROOT_DIR)/env/bin/activate; black -l 120 -S --target-version py38 $(APP_NAME)44 45isort:46 source $(ROOT_DIR)/env/bin/activate; isort --ignore-whitespace --atomic -w 120 $(APP_NAME)