Remove zake driver

It was deprecated due to the zake library abandoned. Now the library
can't be installed due to remaining usage of pkg_resources.

Change-Id: I05607a8116eaf5dc18e5ea132eda6236966242ec
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2026-02-11 20:26:58 +09:00
parent aa92b7f099
commit d1b91ef8eb
19 changed files with 29 additions and 113 deletions

View File

@@ -9,6 +9,7 @@
- release-notes-jobs-python3
check:
jobs:
- tooz-tox-examples
- tooz-tox-py310-etcd3gw
- tooz-tox-py313-etcd3gw
- tooz-tox-py310-zookeeper
@@ -27,6 +28,7 @@
- tooz-tox-py313-consul
gate:
jobs:
- tooz-tox-examples
- tooz-tox-py310-etcd3gw
- tooz-tox-py313-etcd3gw
- tooz-tox-py310-zookeeper
@@ -44,6 +46,14 @@
- tooz-tox-py310-consul
- tooz-tox-py313-consul
- job:
name: tooz-tox-examples
parent: openstack-tox-py312
description: |
Run tests using ``examples`` environment.
vars:
tox_envlist: examples
- job:
name: tooz-tox-py310-consul
parent: openstack-tox-py310

View File

@@ -9,8 +9,6 @@ python-consul2>=0.0.16 # MIT License
requests>=2.10.0 # Apache-2.0
## etcd3gw
etcd3gw>=0.1.0 # Apache-2.0
## zake
zake>=0.1.6 # Apache-2.0
## redis
redis>=3.1.0 # MIT
## postgresql

View File

@@ -68,12 +68,6 @@ Redis
.. autoclass:: tooz.drivers.redis.RedisDriver
:members:
Zake
~~~~
.. autoclass:: tooz.drivers.zake.ZakeDriver
:members:
Zookeeper
~~~~~~~~~

View File

@@ -47,8 +47,6 @@ Driver support
- No
* - :py:class:`~tooz.drivers.redis.RedisDriver`
- Yes
* - :py:class:`~tooz.drivers.zake.ZakeDriver`
- Yes
* - :py:class:`~tooz.drivers.zookeeper.KazooDriver`
- Yes
@@ -89,8 +87,6 @@ Driver support
- No
* - :py:class:`~tooz.drivers.redis.RedisDriver`
- Yes
* - :py:class:`~tooz.drivers.zake.ZakeDriver`
- Yes
* - :py:class:`~tooz.drivers.zookeeper.KazooDriver`
- Yes
@@ -128,7 +124,5 @@ Driver support
- Yes
* - :py:class:`~tooz.drivers.redis.RedisDriver`
- Yes
* - :py:class:`~tooz.drivers.zake.ZakeDriver`
- Yes
* - :py:class:`~tooz.drivers.zookeeper.KazooDriver`
- Yes

View File

@@ -23,14 +23,6 @@ The zookeeper is the reference implementation and provides the most solid
features as it's possible to build a cluster of zookeeper servers that is
resilient towards network partitions for example.
**Test driver:** :py:class:`tooz.drivers.zake.ZakeDriver`
**Characteristics:**
:py:attr:`tooz.drivers.zake.ZakeDriver.CHARACTERISTICS`
**Test driver entrypoint name:** ``zake``
Considerations
~~~~~~~~~~~~~~

View File

@@ -15,6 +15,6 @@
from tooz import coordination
coordinator = coordination.get_coordinator('zake://', b'host-1')
coordinator = coordination.get_coordinator('redis://localhost:6379', b'host-1')
coordinator.start()
coordinator.stop()

View File

@@ -15,6 +15,6 @@
from tooz import coordination
coordinator = coordination.get_coordinator('zake://', b'host-1')
coordinator = coordination.get_coordinator('redis://localhost:6379', b'host-1')
coordinator.start(start_heart=True)
coordinator.stop()

View File

@@ -17,7 +17,7 @@ import uuid
from tooz import coordination
coordinator = coordination.get_coordinator('zake://', b'host-1')
coordinator = coordination.get_coordinator('redis://localhost:6379', b'host-1')
coordinator.start()
# Create a group

View File

@@ -17,7 +17,7 @@ import uuid
from tooz import coordination
coordinator = coordination.get_coordinator('zake://', b'host-1')
coordinator = coordination.get_coordinator('redis://localhost:6379', b'host-1')
coordinator.start()
# Create a group

View File

@@ -19,7 +19,7 @@ import uuid
from tooz import coordination
ALIVE_TIME = 1
coordinator = coordination.get_coordinator('zake://', b'host-1')
coordinator = coordination.get_coordinator('redis://localhost:6379', b'host-1')
coordinator.start()
# Create a group

View File

@@ -15,7 +15,7 @@
from tooz import coordination
coordinator = coordination.get_coordinator('zake://', b'host-1')
coordinator = coordination.get_coordinator('redis://localhost:6379', b'host-1')
coordinator.start()
# Create a lock

View File

@@ -15,7 +15,7 @@
from tooz import coordination
coordinator = coordination.get_coordinator('zake://', b'host-1')
coordinator = coordination.get_coordinator('redis://localhost:6379', b'host-1')
coordinator.start()
partitioner = coordinator.join_partitioned_group("group1")

View File

@@ -36,7 +36,6 @@ Repository = "https://opendev.org/openstack/tooz"
"etcd3+http" = "tooz.drivers.etcd3gw:Etcd3Driver"
"etcd3+https" = "tooz.drivers.etcd3gw:Etcd3Driver"
"kazoo" = "tooz.drivers.zookeeper:KazooDriver"
"zake" = "tooz.drivers.zake:ZakeDriver"
"memcached" = "tooz.drivers.memcached:MemcachedDriver"
"ipc" = "tooz.drivers.ipc:IPCDriver"
"redis" = "tooz.drivers.redis:RedisDriver"
@@ -57,9 +56,6 @@ etcd = [
etcd3gw = [
"etcd3gw>=2.3.0", # Apache-2.0
]
zake = [
"zake>=0.1.6", # Apache-2.0
]
redis = [
"redis>=4.0.0", # MIT
]

View File

@@ -0,0 +1,4 @@
---
upgrade:
- |
The zake driver has been removed.

View File

@@ -7,7 +7,6 @@ ddt>=1.2.1 # MIT
python-consul2>=0.0.16 # MIT License
requests>=2.10.0 # Apache-2.0
etcd3gw>=2.3.0 # Apache-2.0
zake>=0.1.6 # Apache-2.0
redis>=4.0.0 # MIT
psycopg2>=2.5 # LGPL/ZPL
PyMySQL>=0.6.2 # MIT License

View File

@@ -40,7 +40,6 @@ driver_class_names = [
"mysql.MySQLDriver",
"pgsql.PostgresDriver",
"redis.RedisDriver",
"zake.ZakeDriver",
"zookeeper.KazooDriver",
]
driver_headers = []
@@ -81,7 +80,6 @@ grouping_table = [
"No", # MySQL
"No", # PostgreSQL
"Yes", # Redis
"Yes", # Zake
"Yes", # Zookeeper
],
]
@@ -114,7 +112,6 @@ leader_table = [
"No", # MySQL
"No", # PostgreSQL
"Yes", # Redis
"Yes", # Zake
"Yes", # Zookeeper
],
]
@@ -144,7 +141,6 @@ lock_table = [
"Yes", # MySQL
"Yes", # PostgreSQL
"Yes", # Redis
"Yes", # Zake
"Yes", # Zookeeper
],
]

View File

@@ -1,66 +0,0 @@
# Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import warnings
from zake import fake_client
from zake import fake_storage
from tooz import coordination
from tooz.drivers import zookeeper
class ZakeDriver(zookeeper.KazooDriver):
"""This driver uses the `zake`_ client to mimic real `zookeeper`_ servers.
It **should** be mainly used (and **is** really only intended to be used in
this manner) for testing and integration (where real `zookeeper`_ servers
are typically not available).
.. _zake: https://pypi.org/project/zake
.. _zookeeper: http://zookeeper.apache.org/
"""
CHARACTERISTICS = (
coordination.Characteristics.NON_TIMEOUT_BASED,
coordination.Characteristics.DISTRIBUTED_ACROSS_THREADS,
)
"""
Tuple of :py:class:`~tooz.coordination.Characteristics` introspectable
enum member(s) that can be used to interogate how this driver works.
"""
# NOTE(harlowja): this creates a shared backend 'storage' layer that
# would typically exist inside a zookeeper server, but since zake has
# no concept of a 'real' zookeeper server we create a fake one and share
# it among active clients to simulate zookeeper's consistent storage in
# a thread-safe manner.
fake_storage = fake_storage.FakeStorage(
fake_client.k_threading.SequentialThreadingHandler()
)
def __init__(self, member_id, parsed_url, options):
super().__init__(member_id, parsed_url, options)
warnings.warn(
"The zake driver is deprecated, and will be removed in "
"a future release."
)
@classmethod
def _make_client(cls, parsed_url, options):
if 'storage' in options:
storage = options['storage']
else:
storage = cls.fake_storage
return fake_client.FakeClient(storage=storage)

View File

@@ -89,10 +89,6 @@ class TestPartitioner(tests.TestWithCoordinator):
p.stop()
class ZakeTestPartitioner(TestPartitioner):
url = "zake://"
class IPCTestPartitioner(TestPartitioner):
url = "ipc://"

13
tox.ini
View File

@@ -1,6 +1,6 @@
[tox]
minversion = 3.18.0
envlist = py3,py{310,312}-{zookeeper,redis,sentinel,memcached,postgresql,mysql,consul,etcd,etcd3gw,kubernetes},pep8
envlist = py3,py{310,313}-{zookeeper,redis,sentinel,memcached,postgresql,mysql,consul,etcd,etcd3gw,kubernetes},pep8
[testenv]
deps =
@@ -8,7 +8,7 @@ deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
setenv =
TOOZ_TEST_URLS = file:///tmp zake:// ipc://
TOOZ_TEST_URLS = file:///tmp ipc://
zookeeper: TOOZ_TEST_DRIVERS = zookeeper
redis: TOOZ_TEST_DRIVERS = redis
sentinel: TOOZ_TEST_DRIVERS = redis --sentinel
@@ -23,10 +23,8 @@ setenv =
kubernetes: TOOZ_TEST_DRIVERS = kubernetes
allowlist_externals =
{toxinidir}/run-tests.sh
{toxinidir}/run-examples.sh
commands =
{toxinidir}/run-tests.sh stestr run "{posargs}"
{toxinidir}/run-examples.sh
passenv =
ETCD_VERSION
@@ -35,6 +33,12 @@ passenv =
deps = {[testenv:docs]deps}
commands = {posargs}
[testenv:examples]
allowlist_externals =
{toxinidir}/run-examples.sh
commands =
{toxinidir}/run-examples.sh
[testenv:cover]
deps = {[testenv]deps}
setenv = {[testenv]setenv}
@@ -42,7 +46,6 @@ setenv = {[testenv]setenv}
commands =
coverage erase
{toxinidir}/run-tests.sh stestr run "{posargs}"
{toxinidir}/run-examples.sh
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml