2021-06-07 07:10:18 -07:00
|
|
|
.EXPORT_ALL_VARIABLES:
|
|
|
|
commands := $(wildcard bin/*)
|
|
|
|
|
|
|
|
setup: ## Install all the build and lint dependencies
|
|
|
|
pip install -r requirements.txt
|
2021-06-12 06:21:07 -07:00
|
|
|
echo "y" | mypy --install-types
|
2021-06-07 07:10:18 -07:00
|
|
|
|
|
|
|
upgrade: ## Upgrade all the build and lint dependencies
|
|
|
|
pip install --upgrade -r requirements.txt
|
2021-06-12 06:21:07 -07:00
|
|
|
echo "y" | mypy --install-types
|
2021-06-07 07:10:18 -07:00
|
|
|
|
|
|
|
test: ## Run all the tests
|
|
|
|
pytest -rP tests
|
|
|
|
|
|
|
|
#cover: test ## Run all the tests and opens the coverage report
|
|
|
|
# TODO: Coverage
|
|
|
|
|
|
|
|
mypy:
|
|
|
|
rm -rf .tmplintdir .mypy_cache
|
|
|
|
mkdir .tmplintdir
|
|
|
|
for file in bin/* ; do \
|
|
|
|
cp $${file} .tmplintdir/$${file##*/}.py ; \
|
|
|
|
done
|
2021-06-25 07:50:37 -07:00
|
|
|
-mypy --no-incremental --cache-dir=/dev/null mango tests .tmplintdir
|
2021-06-07 07:10:18 -07:00
|
|
|
rm -rf .tmplintdir
|
|
|
|
|
|
|
|
flake8:
|
2021-06-25 07:50:37 -07:00
|
|
|
flake8 --extend-ignore E402,E501,E722,W291,W391 . bin/*
|
2021-06-07 07:10:18 -07:00
|
|
|
|
|
|
|
lint: flake8 mypy
|
|
|
|
|
|
|
|
ci: lint test ## Run all the tests and code checks
|
|
|
|
|
2021-06-25 02:33:40 -07:00
|
|
|
docker-v3-build:
|
|
|
|
docker build --build-arg=LAST_COMMIT="`git log -1 --format='%h [%ad] - %s'`" . -t opinionatedgeek/mango-explorer-v3:experimental
|
2021-06-07 07:10:18 -07:00
|
|
|
|
2021-06-25 02:33:40 -07:00
|
|
|
docker-v3-push:
|
|
|
|
docker push opinionatedgeek/mango-explorer-v3:experimental
|
2021-06-07 07:10:18 -07:00
|
|
|
|
2021-06-25 02:33:40 -07:00
|
|
|
docker-v3: docker-v3-build docker-v3-push
|
2021-06-07 07:10:18 -07:00
|
|
|
|
|
|
|
# Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
|
|
|
help:
|
|
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := help
|