aiogram/Makefile

94 lines
2.5 KiB
Makefile
Raw Normal View History

2019-11-15 12:17:57 +02:00
.DEFAULT_GOAL := help
python := python3.7
.PHONY: help
help:
@echo "======================================================================================="
@echo " aiogram build tools "
@echo "======================================================================================="
2019-11-15 12:44:24 +02:00
@echo "Environment:"
2019-11-15 12:17:57 +02:00
@echo " install: Install development dependencies"
2019-11-15 12:44:24 +02:00
@echo ""
@echo "Code quality:"
2019-11-15 12:17:57 +02:00
@echo " isort: Run isort tool"
@echo " black: Run black tool"
@echo " flake8: Run flake8 tool"
@echo " mypy: Run mypy tool"
@echo " lint: Run isort, black, flake8 and mypy tools"
@echo ""
2019-11-15 12:44:24 +02:00
@echo "Tests:"
@echo " test: Run tests"
@echo ""
2019-11-15 14:11:50 +02:00
@echo "Documentation:"
@echo " docs: Build docs"
@echo " docs-serve: Serve docs for local development"
2019-11-15 12:44:24 +02:00
@echo ""
2019-11-15 12:17:57 +02:00
@echo ""
2019-11-15 14:21:35 +02:00
# =================================================================================================
# Environment
# =================================================================================================
2019-11-15 12:17:57 +02:00
.PHONY: install
install:
$(python) -m pip install --user -U poetry
poetry install
2017-10-22 18:36:13 +03:00
2019-11-15 14:21:35 +02:00
.PHONY: clean
clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]' `
rm -f `find . -type f -name '*~' `
rm -f `find . -type f -name '.*~' `
rm -rf *.egg-info
rm -f .coverage
rm -f .coverage.*
rm -rf {build,dist,site,.cache,.pytest_cache,.mypy_cache}
# =================================================================================================
# Code quality
# =================================================================================================
2019-11-15 12:17:57 +02:00
.PHONY: isort
isort:
poetry run isort -rc aiogram tests
2017-11-15 18:51:29 +02:00
2019-11-15 12:17:57 +02:00
.PHONY: black
black:
poetry run black aiogram tests
2017-12-01 01:59:15 +02:00
2019-11-15 12:17:57 +02:00
.PHONY: flake8
flake8:
poetry run flake8 aiogram tests
2017-12-01 02:14:49 +02:00
2019-11-15 12:17:57 +02:00
.PHONY: mypy
mypy:
poetry run mypy aiogram tests
2017-12-01 02:28:25 +02:00
2019-11-15 12:17:57 +02:00
.PHONY: lint
lint: isort black flake8 mypy
2019-11-15 12:44:24 +02:00
2019-11-15 14:21:35 +02:00
# =================================================================================================
# Tests
# =================================================================================================
2019-11-15 12:44:24 +02:00
.PHONY: test
test:
poetry run pytest --cov=aiogram --cov-config .coveragerc tests/ -sq
2019-11-15 14:11:50 +02:00
2019-11-15 14:21:35 +02:00
# =================================================================================================
# Docs
# =================================================================================================
2019-11-15 14:11:50 +02:00
.PHONY: docs
docs:
mkdocs build
.PHONY: docs-serve
docs-serve:
mkdocs serve