Revert .PHONY in Makefile

This commit is contained in:
Alex Root Junior 2020-05-26 22:13:01 +03:00
parent a627c75bab
commit e4198fb1f2

View file

@ -6,6 +6,7 @@ python := $(py) python
reports_dir := reports reports_dir := reports
.PHONY: help
help: help:
@echo "=======================================================================================" @echo "======================================================================================="
@echo " aiogram build tools " @echo " aiogram build tools "
@ -44,10 +45,12 @@ help:
# Environment # Environment
# ================================================================================================= # =================================================================================================
.PHONY: install
install: install:
$(base_python) -m pip install --user -U poetry $(base_python) -m pip install --user -U poetry
poetry install poetry install
.PHONY: clean
clean: clean:
rm -rf `find . -name __pycache__` rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]' ` rm -f `find . -type f -name '*.py[co]' `
@ -65,9 +68,11 @@ clean:
# Code quality # Code quality
# ================================================================================================= # =================================================================================================
.PHONY: isort
isort: isort:
$(py) isort -rc aiogram tests $(py) isort -rc aiogram tests
.PHONY: black
black: black:
$(py) black aiogram tests $(py) black aiogram tests
@ -78,29 +83,36 @@ flake8-report:
mkdir -p $(reports_dir)/flake8 mkdir -p $(reports_dir)/flake8
$(py) flake8 --format=html --htmldir=$(reports_dir)/flake8 aiogram test $(py) flake8 --format=html --htmldir=$(reports_dir)/flake8 aiogram test
.PHONY: mypy
mypy: mypy:
$(py) mypy aiogram $(py) mypy aiogram
.PHONY: mypy-report
mypy-report: mypy-report:
$(py) mypy aiogram --html-report $(reports_dir)/typechecking $(py) mypy aiogram --html-report $(reports_dir)/typechecking
.PHONY: lint
lint: isort black flake8 mypy lint: isort black flake8 mypy
# ================================================================================================= # =================================================================================================
# Tests # Tests
# ================================================================================================= # =================================================================================================
.PHONY: test
test: test:
$(py) pytest --cov=aiogram --cov-config .coveragerc tests/ $(py) pytest --cov=aiogram --cov-config .coveragerc tests/
.PHONY: test-coverage
test-coverage: test-coverage:
mkdir -p $(reports_dir)/tests/ mkdir -p $(reports_dir)/tests/
$(py) pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ $(py) pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/
.PHONY: test-coverage-report
test-coverage-report: test-coverage-report:
$(py) coverage html -d $(reports_dir)/coverage $(py) coverage html -d $(reports_dir)/coverage
.PHONY: test-coverage-view
test-coverage-view: test-coverage-view:
$(py) coverage html -d $(reports_dir)/coverage $(py) coverage html -d $(reports_dir)/coverage
python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/reports/coverage/index.html')" python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/reports/coverage/index.html')"
@ -109,12 +121,15 @@ test-coverage-view:
# Docs # Docs
# ================================================================================================= # =================================================================================================
.PHONY: docs
docs: docs:
$(py) mkdocs build $(py) mkdocs build
.PHONY: docs-serve
docs-serve: docs-serve:
$(py) mkdocs serve $(py) mkdocs serve
.PHONY: docs-copy-reports
docs-copy-reports: docs-copy-reports:
mv $(reports_dir)/* site/reports mv $(reports_dir)/* site/reports
@ -122,6 +137,7 @@ docs-copy-reports:
# Project # Project
# ================================================================================================= # =================================================================================================
.PHONY: build
build: clean flake8-report mypy-report test-coverage docs docs-copy-reports build: clean flake8-report mypy-report test-coverage docs docs-copy-reports
mkdir -p site/simple mkdir -p site/simple
poetry build poetry build