Skip to content

Commit df6e89b

Browse files
committed
Add deprecated dependency and mark all relevant classes as deprecated
1 parent 4842968 commit df6e89b

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

cassandra/io/eventletreactor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import logging
2525
from threading import Event
2626
import time
27+
from deprecated import deprecated
2728

2829
from cassandra.connection import Connection, ConnectionShutdown, Timer, TimerManager
2930
try:
@@ -45,6 +46,7 @@ def _check_pyopenssl():
4546
)
4647

4748

49+
@deprecated(version="3.30.0", reason="The eventlet event loop is deprecated and will be removed in 3.31.0. See CASSPYTHON-12.")
4850
class EventletConnection(Connection):
4951
"""
5052
An implementation of :class:`.Connection` that utilizes ``eventlet``.

cassandra/io/geventreactor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@
1919
from gevent import socket
2020
import gevent.ssl
2121

22+
from deprecated import deprecated
2223
import logging
2324
import time
2425

25-
2626
from cassandra.connection import Connection, ConnectionShutdown, Timer, TimerManager
2727

28-
2928
log = logging.getLogger(__name__)
3029

31-
30+
@deprecated(version="3.30.0", reason="The gevent event loop is deprecated and will be removed in 3.31.0. See CASSPYTHON-12.")
3231
class GeventConnection(Connection):
3332
"""
3433
An implementation of :class:`.Connection` that utilizes ``gevent``.

cassandra/io/twistedreactor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
( https://twistedmatrix.com ).
1919
"""
2020
import atexit
21+
from deprecated import deprecated
2122
import logging
2223
import time
2324
from functools import partial
@@ -180,7 +181,7 @@ def clientConnectionForTLS(self, tlsProtocol):
180181
connection.set_tlsext_host_name(self.ssl_options['server_hostname'].encode('ascii'))
181182
return connection
182183

183-
184+
@deprecated(version="3.30.0", reason="The Twisted event loop is deprecated and will be removed in 3.31.0. See CASSPYTHON-12.")
184185
class TwistedConnection(Connection):
185186
"""
186187
An implementation of :class:`.Connection` that utilizes the

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ requires = ["setuptools", "Cython>=3.0", "tomli"]
66
name = "cassandra-driver"
77
description = "Apache Cassandra Python Driver"
88
version = "3.30.0"
9-
dependencies = ['geomet>=1.1']
9+
dependencies = ['geomet>=1.1', "Deprecated"]
1010
readme = "README.rst"
1111
authors = [{name = "DataStax"}]
1212
license = "Apache-2.0"

0 commit comments

Comments
 (0)