diff options
author | Taras <voyn1991@gmail.com> | 2017-10-08 17:14:54 +0300 |
---|---|---|
committer | Taras <voyn1991@gmail.com> | 2017-10-14 13:28:41 +0300 |
commit | 4be890dd2a53e7a041767d0b010940897009d136 (patch) | |
tree | e1531a5462de10fe28263a6e6226c5e359d1d9b2 | |
parent | f04435c5ed97fef0975a77a8dc7bae7c284bba63 (diff) | |
download | kafka-python-4be890dd2a53e7a041767d0b010940897009d136.tar.gz |
Add a Makefile, so users with less knowladge can easily build the project, generate docs and run tests.
-rw-r--r-- | Makefile | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..82701e8 --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +# Some simple testing tasks (sorry, UNIX only). + +FLAGS= +KAFKA_VERSION=0.11.0.0 +SCALA_VERSION=2.11 + +setup: + pip install -r requirements-dev.txt + pip install -Ue . + +# Test and produce coverage using tox. This is the same as is run on Travis +test36: + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py36 -- $(FLAGS) + +test27: + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py27 -- $(FLAGS) + +# Test using py.test directly if you want to use local python. Useful for other +# platforms that require manual installation for C libraries, ie. Windows. +test-local: + py.test --pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF kafka test + +cov-local: + py.test --pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF --cov=kafka \ + --cov-config=.covrc --cov-report html kafka test + @echo "open file://`pwd`/htmlcov/index.html" + +# Check the readme for syntax errors, which can lead to invalid formatting on +# PyPi homepage (https://pypi.python.org/pypi/kafka-python) +check-readme: + python setup.py check -rms + +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 -f `find . -type f -name '@*' ` + rm -f `find . -type f -name '#*#' ` + rm -f `find . -type f -name '*.orig' ` + rm -f `find . -type f -name '*.rej' ` + rm -f .coverage + rm -rf htmlcov + rm -rf docs/_build/ + rm -rf cover + rm -rf dist + +doc: + make -C docs html + @echo "open file://`pwd`/docs/_build/html/index.html" + +.PHONY: all test36 test27 test-local cov-local clean doc |