forked from dpkp/kafka-python
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
90 lines (71 loc) · 2.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.DELETE_ON_ERROR:
ifeq ($(findstring .yelpcorp.com,$(shell hostname -f)), .yelpcorp.com)
export PIP_INDEX_URL ?= https://pypi.yelpcorp.com/simple
else
export PIP_INDEX_URL ?= https://pypi.python.org/simple
endif
all: test itest
test:
tox -e py27
tox -e py35
tox -e py36
unit_test_docker:
docker build -t kafka_python_test .
docker run kafka_python_test /work/run_utest.sh
itest:
docker build -t kafka_python_test .
# travis build passes because ipv6 is disabled there
# it passes the integration test locally if we disable ipv6 here
docker run --sysctl net.ipv6.conf.all.disable_ipv6=1 kafka_python_test /work/run_itest.sh
docs:
tox -e docs
FLAGS=
KAFKA_VERSION=1.1.0
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
test35: build-integration
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py35 -- $(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
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) py.test \
--pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF $(FLAGS) kafka test
cov-local: build-integration
KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) py.test \
--pylint --pylint-rcfile=pylint.rc --pylint-error-types=EF --cov=kafka \
--cov-config=.covrc --cov-report html $(FLAGS) 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
rm -rf kafka-python.egg-info/ .tox/
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
docker rmi -f kafka_python_test
doc:
make -C docs html
@echo "open file://`pwd`/docs/_build/html/index.html"
.PHONY: all test test35 test27 test-local cov-local clean doc