Skip to content

Commit

Permalink
feat(CI): Keep only Python 3.{6,7} to CI and bump ZK versions to late…
Browse files Browse the repository at this point in the history
…sts (#574)

* Switching to xenial distrib to make python 3.7 available

* Testing against 3.5.5 instead of 3.5.4-beta and deploying new version for python 3.7 and zk 3.5.5

* Testing against zk 3.4.14 instead of 3.4.13

* Change pattern for slf4j-log4j lib

* Since ZOOKEEPER-3156 it is now required to be authed to access ACLs

* Drop support for ZK 3.3.x and Python 3.{4,5}
  • Loading branch information
StephenSorriaux committed Oct 9, 2019
1 parent 961b2f3 commit c293aab
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 40 deletions.
55 changes: 21 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sudo: false
dist: xenial
addons:
apt:
packages:
Expand All @@ -15,51 +16,37 @@ matrix:
- python: '2.7'
include:
- python: '2.7'
env: ZOOKEEPER_VERSION=3.3.6 TOX_VENV=py27
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py27
- python: '2.7'
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=py27
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py27
- python: '2.7'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=py27
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py27-gevent
- python: '2.7'
env: ZOOKEEPER_VERSION=3.3.6 TOX_VENV=py27-gevent
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py27-gevent
- python: '2.7'
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=py27-gevent
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py27-eventlet
- python: '2.7'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=py27-gevent
- python: '2.7'
env: ZOOKEEPER_VERSION=3.3.6 TOX_VENV=py27-eventlet
- python: '2.7'
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=py27-eventlet
- python: '2.7'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=py27-eventlet
- python: '3.4'
env: ZOOKEEPER_VERSION=3.3.6 TOX_VENV=py34
- python: '3.4'
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=py34
- python: '3.4'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=py34
- python: '3.5'
env: ZOOKEEPER_VERSION=3.3.6 TOX_VENV=py35
- python: '3.5'
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=py35
- python: '3.5'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=py35
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py27-eventlet
- python: '3.6'
env: ZOOKEEPER_VERSION=3.3.6 TOX_VENV=py36
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py36
- python: '3.6'
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=py36 DEPLOY=true
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py36-sasl
- python: '3.6'
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=py36-sasl
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py36
- python: '3.6'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=py36
- python: '3.6'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=py36-sasl
- python: pypy
env: ZOOKEEPER_VERSION=3.3.6 TOX_VENV=pypy
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py36-sasl
- python: '3.7'
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py37
- python: '3.7'
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=py37-sasl
- python: '3.7'
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py37 DEPLOY=true
- python: '3.7'
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=py37-sasl
- python: pypy
env: ZOOKEEPER_VERSION=3.4.13 TOX_VENV=pypy
env: ZOOKEEPER_VERSION=3.4.14 TOX_VENV=pypy
- python: 'pypy'
env: ZOOKEEPER_VERSION=3.5.4-beta TOX_VENV=pypy
env: ZOOKEEPER_VERSION=3.5.5 ZOOKEEPER_PREFIX="apache-" ZOOKEEPER_SUFFIX="-bin" ZOOKEEPER_LIB="lib" TOX_VENV=pypy
notifications:
email: false
install:
Expand Down
9 changes: 6 additions & 3 deletions ensure-zookeeper-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ HERE=`pwd`
ZOO_BASE_DIR="$HERE/zookeeper"
ZOOKEEPER_VERSION=${ZOOKEEPER_VERSION:-3.4.10}
ZOOKEEPER_PATH="$ZOO_BASE_DIR/$ZOOKEEPER_VERSION"
ZOOKEEPER_PREFIX=${ZOOKEEPER_PREFIX}
ZOOKEEPER_SUFFIX=${ZOOKEEPER_SUFFIX}
ZOO_MIRROR_URL="http://archive.apache.org/dist"


function download_zookeeper(){
mkdir -p $ZOO_BASE_DIR
cd $ZOO_BASE_DIR
curl --silent -C - $ZOO_MIRROR_URL/zookeeper/zookeeper-$ZOOKEEPER_VERSION/zookeeper-$ZOOKEEPER_VERSION.tar.gz | tar -zx
mv zookeeper-$ZOOKEEPER_VERSION $ZOOKEEPER_VERSION
curl --silent -C - $ZOO_MIRROR_URL/zookeeper/zookeeper-$ZOOKEEPER_VERSION/${ZOOKEEPER_PREFIX}zookeeper-${ZOOKEEPER_VERSION}${ZOOKEEPER_SUFFIX}.tar.gz | tar -zx
mv ${ZOOKEEPER_PREFIX}zookeeper-${ZOOKEEPER_VERSION}${ZOOKEEPER_SUFFIX} $ZOOKEEPER_VERSION
chmod a+x $ZOOKEEPER_PATH/bin/zkServer.sh
}

Expand All @@ -24,7 +26,8 @@ else
echo "Already downloaded zookeeper $ZOOKEEPER_VERSION to $ZOOKEEPER_PATH"
fi

export ZOOKEEPER_PATH
# Used as install_path when starting ZK
export ZOOKEEPER_PATH="${ZOOKEEPER_PATH}/${ZOOKEEPER_LIB}"
cd $HERE

# Yield execution to venv command
Expand Down
2 changes: 1 addition & 1 deletion kazoo/testing/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def classpath(self):
"slf4j-api-*.jar")))
jars.extend(glob(os.path.join(
self.install_path,
"slf4j-log4j-*.jar")))
"slf4j-log4j*.jar")))
else:
# Development build (plain `ant`)
jars = glob((os.path.join(
Expand Down
10 changes: 8 additions & 2 deletions kazoo/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,10 +887,13 @@ def test_create_delete(self):

def test_get_acls(self):
from kazoo.security import make_digest_acl
acl = make_digest_acl('user', 'pass', all=True)
user = 'user'
passw = 'pass'
acl = make_digest_acl(user, passw, all=True)
client = self.client
try:
client.create('/a', acl=[acl])
client.add_auth('digest', '{}:{}'.format(user, passw))
self.assertTrue(acl in client.get_acls('/a')[0])
finally:
client.delete('/a')
Expand All @@ -901,11 +904,14 @@ def test_get_acls_invalid_arguments(self):

def test_set_acls(self):
from kazoo.security import make_digest_acl
acl = make_digest_acl('user', 'pass', all=True)
user = 'user'
passw = 'pass'
acl = make_digest_acl(user, passw, all=True)
client = self.client
client.create('/a')
try:
client.set_acls('/a', [acl])
client.add_auth('digest', '{}:{}'.format(user, passw))
self.assertTrue(acl in client.get_acls('/a')[0])
finally:
client.delete('/a')
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Communications",
Expand Down
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ envlist =
py35-sasl,
py36,
py36-{sasl,docs},
py37,
py37-{sasl,docs},
pypy

[testenv:pep8]
Expand All @@ -22,6 +24,9 @@ install_command = pip install {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
ZOOKEEPER_VERSION={env:ZOOKEEPER_VERSION:}
ZOOKEEPER_PREFIX={env:ZOOKEEPER_PREFIX:}
ZOOKEEPER_SUFFIX={env:ZOOKEEPER_SUFFIX:}
ZOOKEEPER_LIB={env:ZOOKEEPER_LIB:}
deps = -r{toxinidir}/requirements.txt
docs: -r{toxinidir}/requirements_sphinx.txt
gevent: -r{toxinidir}/requirements_gevent.txt
Expand Down

0 comments on commit c293aab

Please sign in to comment.