|
| 1 | +# Some simple testing tasks (sorry, UNIX only). |
| 2 | + |
| 3 | +FLAGS= |
| 4 | +KAFKA_VERSION=0.11.0.1 |
| 5 | +SCALA_VERSION=2.12 |
| 6 | + |
| 7 | +setup: |
| 8 | + pip install -r requirements-dev.txt |
| 9 | + pip install -Ue . |
| 10 | + |
| 11 | +servers/$(KAFKA_VERSION)/kafka-bin: |
| 12 | + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) ./build_integration.sh |
| 13 | + |
| 14 | +build-integration: servers/$(KAFKA_VERSION)/kafka-bin |
| 15 | + |
| 16 | +# Test and produce coverage using tox. This is the same as is run on Travis |
| 17 | +test36: build-integration |
| 18 | + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py36 -- $(FLAGS) |
| 19 | + |
| 20 | +test27: build-integration |
| 21 | + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py27 -- $(FLAGS) |
| 22 | + |
| 23 | +# Test using py.test directly if you want to use local python. Useful for other |
| 24 | +# platforms that require manual installation for C libraries, ie. Windows. |
| 25 | +test-local: build-integration |
| 26 | + py.test --pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF kafka test |
| 27 | + |
| 28 | +cov-local: build-integration |
| 29 | + py.test --pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF --cov=kafka \ |
| 30 | + --cov-config=.covrc --cov-report html kafka test |
| 31 | + @echo "open file://`pwd`/htmlcov/index.html" |
| 32 | + |
| 33 | +# Check the readme for syntax errors, which can lead to invalid formatting on |
| 34 | +# PyPi homepage (https://pypi.python.org/pypi/kafka-python) |
| 35 | +check-readme: |
| 36 | + python setup.py check -rms |
| 37 | + |
| 38 | +clean: |
| 39 | + rm -rf `find . -name __pycache__` |
| 40 | + rm -f `find . -type f -name '*.py[co]' ` |
| 41 | + rm -f `find . -type f -name '*~' ` |
| 42 | + rm -f `find . -type f -name '.*~' ` |
| 43 | + rm -f `find . -type f -name '@*' ` |
| 44 | + rm -f `find . -type f -name '#*#' ` |
| 45 | + rm -f `find . -type f -name '*.orig' ` |
| 46 | + rm -f `find . -type f -name '*.rej' ` |
| 47 | + rm -f .coverage |
| 48 | + rm -rf htmlcov |
| 49 | + rm -rf docs/_build/ |
| 50 | + rm -rf cover |
| 51 | + rm -rf dist |
| 52 | + |
| 53 | +doc: |
| 54 | + make -C docs html |
| 55 | + @echo "open file://`pwd`/docs/_build/html/index.html" |
| 56 | + |
| 57 | +.PHONY: all test36 test27 test-local cov-local clean doc |
0 commit comments