2016-03-15 02:56:20 +01:00
|
|
|
.DEFAULT_GOAL := help
|
2020-10-31 16:33:34 +01:00
|
|
|
.PHONY: clean pep8 black lint test install
|
2015-07-07 22:19:26 +02:00
|
|
|
|
2016-02-06 10:34:38 +01:00
|
|
|
PYLINT := pylint
|
2017-08-11 23:58:41 +02:00
|
|
|
PYTEST := pytest
|
2016-02-06 10:34:38 +01:00
|
|
|
PEP8 := flake8
|
2020-10-31 16:33:34 +01:00
|
|
|
BLACK := black
|
2020-10-06 19:28:40 +02:00
|
|
|
MYPY := mypy
|
2016-02-06 10:34:38 +01:00
|
|
|
PIP := pip
|
|
|
|
|
2015-07-07 22:19:26 +02:00
|
|
|
clean:
|
|
|
|
rm -fr build
|
|
|
|
rm -fr dist
|
|
|
|
find . -name '*.pyc' -exec rm -f {} \;
|
|
|
|
find . -name '*.pyo' -exec rm -f {} \;
|
|
|
|
find . -name '*~' -exec rm -f {} \;
|
2020-10-31 16:33:34 +01:00
|
|
|
find . -regex "./telegram[0-9]*.\(jpg\|mp3\|mp4\|ogg\|png\|webp\)" -exec rm {} \;
|
2016-01-13 17:09:35 +01:00
|
|
|
|
2015-08-28 22:45:44 +02:00
|
|
|
pep8:
|
2020-10-31 16:33:34 +01:00
|
|
|
$(PEP8) telegram tests examples
|
2016-05-15 04:46:21 +02:00
|
|
|
|
2020-10-31 16:33:34 +01:00
|
|
|
black:
|
|
|
|
$(BLACK) .
|
2015-08-28 22:45:44 +02:00
|
|
|
|
2015-07-07 22:19:26 +02:00
|
|
|
lint:
|
2020-10-31 16:33:34 +01:00
|
|
|
$(PYLINT) --rcfile=setup.cfg telegram examples
|
2015-07-07 22:19:26 +02:00
|
|
|
|
2020-10-06 19:28:40 +02:00
|
|
|
mypy:
|
|
|
|
$(MYPY) -p telegram
|
2020-10-31 16:33:34 +01:00
|
|
|
$(MYPY) examples
|
2020-10-06 19:28:40 +02:00
|
|
|
|
2015-07-07 22:19:26 +02:00
|
|
|
test:
|
2017-08-11 23:58:41 +02:00
|
|
|
$(PYTEST) -v
|
2015-09-07 21:28:00 +02:00
|
|
|
|
2015-11-10 15:10:50 +01:00
|
|
|
install:
|
2016-05-15 03:24:35 +02:00
|
|
|
$(PIP) install -r requirements.txt -r requirements-dev.txt
|
2015-11-10 15:10:50 +01:00
|
|
|
|
2015-08-28 18:02:02 +02:00
|
|
|
help:
|
2015-08-28 22:45:44 +02:00
|
|
|
@echo "Available targets:"
|
|
|
|
@echo "- clean Clean up the source directory"
|
|
|
|
@echo "- pep8 Check style with flake8"
|
|
|
|
@echo "- lint Check style with pylint"
|
2020-10-31 16:33:34 +01:00
|
|
|
@echo "- black Check style with black"
|
2020-10-06 19:28:40 +02:00
|
|
|
@echo "- mypy Check type hinting with mypy"
|
2017-08-11 23:58:41 +02:00
|
|
|
@echo "- test Run tests using pytest"
|
2016-02-06 10:34:38 +01:00
|
|
|
@echo
|
|
|
|
@echo "Available variables:"
|
|
|
|
@echo "- PYLINT default: $(PYLINT)"
|
2017-08-11 23:58:41 +02:00
|
|
|
@echo "- PYTEST default: $(PYTEST)"
|
2016-02-06 10:34:38 +01:00
|
|
|
@echo "- PEP8 default: $(PEP8)"
|
2020-10-31 16:33:34 +01:00
|
|
|
@echo "- BLACK default: $(BLACK)"
|
2020-10-06 19:28:40 +02:00
|
|
|
@echo "- MYPY default: $(MYPY)"
|
2016-02-06 10:34:38 +01:00
|
|
|
@echo "- PIP default: $(PIP)"
|