diff --git a/.travis.yml b/.travis.yml index fd6018b5a..cdb93396d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ language: python +dist: xenial + python: - 2.7 - 3.4 - - 3.5 - - 3.6 - - pypy + - 3.7 + - pypy2.7-6.0 env: - KAFKA_VERSION=0.8.2.2 @@ -18,6 +19,7 @@ addons: apt: packages: - libsnappy-dev + - openjdk-8-jdk cache: directories: @@ -25,6 +27,7 @@ cache: - servers/ before_install: + - source travis_java_install.sh - ./build_integration.sh install: @@ -32,7 +35,7 @@ install: - pip install . script: - - tox -e `if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then echo pypy; else echo py${TRAVIS_PYTHON_VERSION/./}; fi` + - tox -e `if [ "$TRAVIS_PYTHON_VERSION" == "pypy2.7-6.0" ]; then echo pypy; else echo py${TRAVIS_PYTHON_VERSION/./}; fi` after_success: - coveralls diff --git a/Makefile b/Makefile index 7dfd305e6..b4dcbffc9 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ servers/$(KAFKA_VERSION)/kafka-bin: 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) +test37: build-integration + KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py37 -- $(FLAGS) test27: build-integration KAFKA_VERSION=$(KAFKA_VERSION) SCALA_VERSION=$(SCALA_VERSION) tox -e py27 -- $(FLAGS) @@ -56,4 +56,4 @@ doc: make -C docs html @echo "open file://`pwd`/docs/_build/html/index.html" -.PHONY: all test36 test27 test-local cov-local clean doc +.PHONY: all test37 test27 test-local cov-local clean doc diff --git a/docs/compatibility.rst b/docs/compatibility.rst index 85b2c59db..ce222ee63 100644 --- a/docs/compatibility.rst +++ b/docs/compatibility.rst @@ -12,6 +12,6 @@ through 0.8.0 . kafka-python is not compatible with the 0.8.2-beta release. Because the kafka server protocol is backwards compatible, kafka-python is expected to work with newer broker releases as well (2.0+). -kafka-python is tested on python 2.7, 3.4, 3.5, 3.6 and pypy. +kafka-python is tested on python 2.7, 3.4, 3.5, 3.6, 3.7, and pypy. Builds and tests via Travis-CI. See https://travis-ci.org/dpkp/kafka-python diff --git a/setup.py b/setup.py index 9dcdb8eaa..779adb92b 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,7 @@ def run(cls): "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", ] diff --git a/tox.ini b/tox.ini index 1da88f304..48a143eea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{26,27,34,35,36,py}, docs +envlist = py{26,27,34,35,36,37,py}, docs [pytest] testpaths = kafka test @@ -11,8 +11,8 @@ log_format = %(created)f %(filename)-23s %(threadName)s %(message)s deps = pytest<4.0 pytest-cov - py{27,34,35,36,py}: pylint - py{27,34,35,36,py}: pytest-pylint + py{27,34,35,36,37,py}: pylint + py{27,34,35,36,37,py}: pytest-pylint pytest-mock mock python-snappy diff --git a/travis_java_install.sh b/travis_java_install.sh new file mode 100644 index 000000000..f662ce274 --- /dev/null +++ b/travis_java_install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# borrowed from: https://github.com/mansenfranzen/pywrangler/blob/master/tests/travis_java_install.sh + +# Kafka requires Java 8 in order to work properly. However, TravisCI's Ubuntu +# 16.04 ships with Java 11 and Java can't be set with `jdk` when python is +# selected as language. Ubuntu 14.04 does not work due to missing python 3.7 +# support on TravisCI which does have Java 8 as default. + +# show current JAVA_HOME and java version +echo "Current JAVA_HOME: $JAVA_HOME" +echo "Current java -version:" +which java +java -version + +echo "Updating JAVA_HOME" +# change JAVA_HOME to Java 8 +export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 + +echo "Updating PATH" +export PATH=${PATH/\/usr\/local\/lib\/jvm\/openjdk11\/bin/$JAVA_HOME\/bin} + +echo "New java -version" +which java +java -version