Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cassandra/io/eventletreactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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``.
Expand Down
5 changes: 2 additions & 3 deletions cassandra/io/geventreactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down
3 changes: 2 additions & 1 deletion cassandra/io/twistedreactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
( https://twistedmatrix.com ).
"""
import atexit
from deprecated import deprecated
import logging
import time
from functools import partial
Expand Down Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this paragraph, asyncore is mentioned without literal formatting while other module names are consistently marked up (e.g., asyncore / libev). For consistency and to avoid Sphinx formatting drift, wrap this asyncore occurrence in double backticks.

Suggested change
asyncore from the runtime but this event loop can still be used in newer versions of Python via the
``asyncore`` from the runtime but this event loop can still be used in newer versions of Python via the

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with this suggestion for two reasons.

First, I prefer the idea of highlighting the first usage of a name and then leaving all other subsequent usages to be rendered as regular text.

Second (and perhaps more importantly): the second usage refers to the asyncore package in the Python runtime and not the asyncore event loop built on that package. They are two different things and using the same formatting to indicate the would confuse the issue.

`pyasyncore <https://pypi.org/project/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
^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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>=1.3.1"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that this dependency will only be present for this release. The plan is to remove the event loops in question in the next release (currently slated to be 3.31.0) and at that time deprecated can be removed as a dependency as well.

readme = "README.rst"
authors = [{name = "DataStax"}]
license = "Apache-2.0"
Expand All @@ -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"
Expand Down
Loading