2023-05-10 17:38:32 +00:00
|
|
|
SHELL:=/bin/bash -o pipefail
|
|
|
|
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
PYTHON:=python3
|
|
|
|
|
2023-06-30 20:41:51 +00:00
|
|
|
env:
|
2023-05-10 17:38:32 +00:00
|
|
|
if [ ! -d $(ROOT_DIR)/env ]; then $(PYTHON) -m venv $(ROOT_DIR)/env; fi
|
|
|
|
|
2023-06-30 20:41:51 +00:00
|
|
|
dev: env
|
|
|
|
source env/bin/activate; pip install black isort pytest; pip install -e .
|
|
|
|
|
2023-05-10 17:38:32 +00:00
|
|
|
documentation:
|
|
|
|
rm -rf ./site && mkdocs build
|
|
|
|
|
|
|
|
wheel:
|
|
|
|
rm -rf dist/ build/ gpt4all/llmodel_DO_NOT_MODIFY; python setup.py bdist_wheel;
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf {.pytest_cache,env,gpt4all.egg-info}
|
2023-06-30 20:02:02 +00:00
|
|
|
find . | grep -E "(__pycache__|\.pyc|\.pyo$\)" | xargs rm -rf
|
|
|
|
|
|
|
|
black:
|
|
|
|
source env/bin/activate; black -l 120 -S --target-version py36 gpt4all
|
|
|
|
|
|
|
|
isort:
|
|
|
|
source env/bin/activate; isort --ignore-whitespace --atomic -w 120 gpt4all
|
|
|
|
|
|
|
|
test:
|
2023-07-04 01:30:24 +00:00
|
|
|
source env/bin/activate; pytest -s gpt4all/tests -k "not test_inference_long"
|
|
|
|
|
|
|
|
test_all:
|
2023-06-30 20:41:51 +00:00
|
|
|
source env/bin/activate; pytest -s gpt4all/tests
|