From df6e89b01aae0239d26a41de8866e0603439800d Mon Sep 17 00:00:00 2001 From: absurdfarce Date: Mon, 9 Mar 2026 15:57:41 -0500 Subject: [PATCH 1/4] Add deprecated dependency and mark all relevant classes as deprecated --- cassandra/io/eventletreactor.py | 2 ++ cassandra/io/geventreactor.py | 5 ++--- cassandra/io/twistedreactor.py | 3 ++- pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cassandra/io/eventletreactor.py b/cassandra/io/eventletreactor.py index 94e1e49544..6be7738236 100644 --- a/cassandra/io/eventletreactor.py +++ b/cassandra/io/eventletreactor.py @@ -24,6 +24,7 @@ import logging from threading import Event import time +from deprecated import deprecated from cassandra.connection import Connection, ConnectionShutdown, Timer, TimerManager try: @@ -45,6 +46,7 @@ def _check_pyopenssl(): ) +@deprecated(version="3.30.0", reason="The eventlet event loop is deprecated and will be removed in 3.31.0. See CASSPYTHON-12.") class EventletConnection(Connection): """ An implementation of :class:`.Connection` that utilizes ``eventlet``. diff --git a/cassandra/io/geventreactor.py b/cassandra/io/geventreactor.py index 8ad4ee99e7..eb1296d6f9 100644 --- a/cassandra/io/geventreactor.py +++ b/cassandra/io/geventreactor.py @@ -19,16 +19,15 @@ from gevent import socket import gevent.ssl +from deprecated import deprecated import logging import time - from cassandra.connection import Connection, ConnectionShutdown, Timer, TimerManager - log = logging.getLogger(__name__) - +@deprecated(version="3.30.0", reason="The gevent event loop is deprecated and will be removed in 3.31.0. See CASSPYTHON-12.") class GeventConnection(Connection): """ An implementation of :class:`.Connection` that utilizes ``gevent``. diff --git a/cassandra/io/twistedreactor.py b/cassandra/io/twistedreactor.py index b55ac4d1a3..58e79e9ce9 100644 --- a/cassandra/io/twistedreactor.py +++ b/cassandra/io/twistedreactor.py @@ -18,6 +18,7 @@ ( https://twistedmatrix.com ). """ import atexit +from deprecated import deprecated import logging import time from functools import partial @@ -180,7 +181,7 @@ def clientConnectionForTLS(self, tlsProtocol): connection.set_tlsext_host_name(self.ssl_options['server_hostname'].encode('ascii')) return connection - +@deprecated(version="3.30.0", reason="The Twisted event loop is deprecated and will be removed in 3.31.0. See CASSPYTHON-12.") class TwistedConnection(Connection): """ An implementation of :class:`.Connection` that utilizes the diff --git a/pyproject.toml b/pyproject.toml index 0a3fb577d9..ab987bccec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = ["setuptools", "Cython>=3.0", "tomli"] name = "cassandra-driver" description = "Apache Cassandra Python Driver" version = "3.30.0" -dependencies = ['geomet>=1.1'] +dependencies = ['geomet>=1.1', "Deprecated"] readme = "README.rst" authors = [{name = "DataStax"}] license = "Apache-2.0" From f6080d163cef84c8808104cbb65c29f903d6dc54 Mon Sep 17 00:00:00 2001 From: absurdfarce Date: Tue, 10 Mar 2026 15:12:33 -0500 Subject: [PATCH 2/4] Updated support event loop verbiage in installation docs --- docs/installation.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index be31551e79..12c0ad300b 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -217,10 +217,16 @@ dependencies, then use install-option:: Supported Event Loops ^^^^^^^^^^^^^^^^^^^^^ -For Python versions before 3.12 the driver uses the ``asyncore`` module for its default -event loop. Other event loops such as ``libev``, ``gevent`` and ``eventlet`` are also -available via Python modules or C extensions. Python 3.12 has removed ``asyncore`` entirely -so for this platform one of these other event loops must be used. +The ``asyncore`` and ``libev`` event loops are proven production-grade event loops. Python 3.12 removed +asyncore from the runtime but this event loop can still be used in newer versions of Python via the +`pyasyncore `_ package. + +The ``asyncio`` event loop is generally functional but still somewhat experimental and not recommended +for production systems. We anticipate significant improvements to this event loop (including hopefully +making this event loop the default going forward) in 3.31.0. + +The ``gevent``, ``eventlet`` and ``Twisted`` event loops have been deprecated in 3.30.0 and will be removed +completely in 3.31.0. libev support ^^^^^^^^^^^^^ From a739756c2f7f6bd9b9d138bfab1d966c10cb1a7d Mon Sep 17 00:00:00 2001 From: absurdfarce Date: Thu, 12 Mar 2026 16:21:05 -0500 Subject: [PATCH 3/4] Fix from code review: Brad noted the mismatch between supported Python versions and the list of versions we included in the classifiers. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ab987bccec..c5cf12ddf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,11 +19,11 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" From 7bfd4f330e9e46b4b1a588af4d912045239ac8ac Mon Sep 17 00:00:00 2001 From: absurdfarce Date: Thu, 12 Mar 2026 16:39:12 -0500 Subject: [PATCH 4/4] Code review feedback --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c5cf12ddf4..c5a17bae41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = ["setuptools", "Cython>=3.0", "tomli"] name = "cassandra-driver" description = "Apache Cassandra Python Driver" version = "3.30.0" -dependencies = ['geomet>=1.1', "Deprecated"] +dependencies = ['geomet>=1.1', "Deprecated>=1.3.1"] readme = "README.rst" authors = [{name = "DataStax"}] license = "Apache-2.0"