diff options
author | Taras Voinarovskyi <voyn1991@gmail.com> | 2017-10-14 23:04:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-14 23:04:58 +0300 |
commit | dd8e33654f2270097d6c1373dc272153670e48f8 (patch) | |
tree | a9ab68f349bbdee06233fe7f0f8c6eb341ed388f | |
parent | cfddc6bd179e236874e00a899e9349d5c9a54400 (diff) | |
parent | 2d3608225d137dc8e43cb75e7ee4f20e98b59971 (diff) | |
download | kafka-python-dd8e33654f2270097d6c1373dc272153670e48f8.tar.gz |
Merge pull request #1247 from dpkp/add_makefile
Add a Makefile
-rw-r--r-- | Makefile | 57 | ||||
-rw-r--r-- | requirements-dev.txt | 15 |
2 files changed, 72 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..73c3ecf --- /dev/null +++ b/Makefile @@ -0,0 +1,57 @@ +# Some simple testing tasks (sorry, UNIX only). + +FLAGS= +KAFKA_VERSION=0.11.0.1 +SCALA_VERSION=2.12 + +setup: + pip install -r requirements-dev.txt + pip install -Ue . + +servers/$(KAFKA_VERSION)/kafka-bin: + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) ./build_integration.sh + +build-integration: servers/$(KAFKA_VERSION)/kafka-bin + +# Test and produce coverage using tox. This is the same as is run on Travis +test36: build-integration + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py36 -- $(FLAGS) + +test27: build-integration + 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: build-integration + py.test --pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF kafka test + +cov-local: build-integration + 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 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..dd56df6 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,15 @@ +flake8==3.4.1 +pytest==3.2.2 +pytest-cov==2.5.1 +pytest-catchlog==1.2.2 +docker-py==1.10.6 +coveralls==1.2.0 +Sphinx==1.6.4 +lz4==0.10.1 +xxhash==1.0.1 +python-snappy==0.5.1 +tox==2.9.1 +pytest-pylint==0.7.1 +# pytest-sugar==0.9.0 +pytest-mock==1.6.3 +sphinx-rtd-theme==0.2.4 |