This is an automated email from the ASF dual-hosted git repository.

absurdfarce pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-python-driver.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a93d4f40 CASSPYTHON-14 Drop pypy support
a93d4f40 is described below

commit a93d4f40eaa5aacd8b971f6355e8450cb50d03c4
Author: absurdfarce <[email protected]>
AuthorDate: Sun Jul 19 20:26:55 2026 -0500

    CASSPYTHON-14 Drop pypy support
    
    patch by Bret McGuire; reviewed by Bret McGuire and Brad Schoening
---
 README-dev.rst                                  |  2 +-
 cassandra/cmurmur3.c                            | 13 -------------
 cassandra/metadata.py                           |  3 ---
 docs/installation.rst                           |  9 +++++----
 docs/performance.rst                            |  6 ------
 pyproject.toml                                  |  3 +--
 setup.py                                        | 12 +-----------
 tests/__init__.py                               |  3 ---
 tests/integration/__init__.py                   |  1 -
 tests/integration/cqlengine/model/test_model.py |  4 ----
 tests/unit/test_policies.py                     | 20 +++++---------------
 tox.ini                                         |  2 +-
 12 files changed, 14 insertions(+), 64 deletions(-)

diff --git a/README-dev.rst b/README-dev.rst
index 3f8789cb..a2dacb18 100644
--- a/README-dev.rst
+++ b/README-dev.rst
@@ -96,7 +96,7 @@ it with the ``PROTOCOL_VERSION`` environment variable::
 
 Testing Multiple Python Versions
 --------------------------------
-Use tox to test all of Python 3.10 through 3.14 and pypy::
+Use tox to test all currently supported versions of the Python runtime::
 
     tox
 
diff --git a/cassandra/cmurmur3.c b/cassandra/cmurmur3.c
index 4affdad4..2655b548 100644
--- a/cassandra/cmurmur3.c
+++ b/cassandra/cmurmur3.c
@@ -14,13 +14,6 @@
 #include <Python.h>
 #include <stdio.h>
 
-#ifdef PYPY_VERSION
-#define COMPILING_IN_PYPY 1
-#define COMPILING_IN_CPYTHON 0
-#else
-#define COMPILING_IN_PYPY 0
-#define COMPILING_IN_CPYTHON 1
-#endif
 //-----------------------------------------------------------------------------
 // Platform-specific functions and macros
 
@@ -179,13 +172,7 @@ struct module_state {
     PyObject *error;
 };
 
-// pypy3 doesn't have GetState yet.
-#if COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
-#else
-#define GETSTATE(m) (&_state)
-static struct module_state _state;
-#endif
 
 static PyObject *
 murmur3(PyObject *self, PyObject *args)
diff --git a/cassandra/metadata.py b/cassandra/metadata.py
index 4c1be285..86464415 100644
--- a/cassandra/metadata.py
+++ b/cassandra/metadata.py
@@ -1875,9 +1875,6 @@ class BytesToken(Token):
     @classmethod
     def from_string(cls, token_string):
         """ `token_string` should be the string representation from the 
server. """
-        # unhexlify works fine with unicode input in everythin but pypy3, 
where it Raises "TypeError: 'str' does not support the buffer interface"
-        if isinstance(token_string, str):
-            token_string = token_string.encode('ascii')
         # The BOP stores a hex string
         return cls(unhexlify(token_string))
 
diff --git a/docs/installation.rst b/docs/installation.rst
index 93eb9e89..d1813cab 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -3,10 +3,10 @@ Installation
 
 Supported Platforms
 -------------------
-Python 3.10 through 3.14 are supported.  Both CPython (the standard Python
-implementation) and `PyPy <http://pypy.org>`_ are supported and tested.
+Python 3.10 through 3.14 are supported.  Linux, OSX, and Windows are supported.
 
-Linux, OSX, and Windows are supported.
+As of Python driver 4.0.0 only CPython is supported.  Prior versions also 
explicitly supported PyPy but we no longer
+support this runtime.  See `CASSPYTHON-14 
<https://issues.apache.org/jira/browse/CASSPYTHON-14>`_ for additional 
information.
 
 Installation through pip
 ------------------------
@@ -18,7 +18,8 @@ the same time as the driver itself.  To install the driver*::
 
 You can use ``pip install --pre cassandra-driver`` if you need to install a 
beta version.
 
-***Note**: if intending to use optional extensions, install the `dependencies 
<#optional-non-python-dependencies>`_ first. The driver may need to be 
reinstalled if dependencies are added after the initial installation.
+***Note**: if intending to use optional extensions, install the `dependencies 
<#optional-non-python-dependencies>`_ first.
+The driver may need to be reinstalled if dependencies are added after the 
initial installation.
 
 Verifying your Installation
 ---------------------------
diff --git a/docs/performance.rst b/docs/performance.rst
index f7a3f49e..8813d702 100644
--- a/docs/performance.rst
+++ b/docs/performance.rst
@@ -17,12 +17,6 @@ provide this pattern with a synchronous API and tunable 
concurrency.
 Due to the GIL and limited concurrency, the driver can become CPU-bound pretty 
quickly. The sections below
 discuss further runtime and design considerations for mitigating this 
limitation.
 
-PyPy
-----
-`PyPy <http://pypy.org>`_ is an alternative Python runtime which uses a JIT 
compiler to
-reduce CPU consumption. This leads to a huge improvement in the driver 
performance,
-more than doubling throughput for many workloads.
-
 Cython Extensions
 -----------------
 `Cython <http://cython.org/>`_ is an optimizing compiler and language that can 
be used to compile the core files and
diff --git a/pyproject.toml b/pyproject.toml
index 9f237f0e..412225e6 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.1"
-dependencies = ['geomet>=1.1', "Deprecated>=1.3.1"]
+dependencies = ['geomet>=1.1']
 readme = "README.rst"
 authors = [{name = "DataStax"}]
 license = "Apache-2.0"
@@ -25,7 +25,6 @@ classifiers = [
     "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"
 ]
 
diff --git a/setup.py b/setup.py
index 07ea3844..9d1b3886 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,6 @@ except ImportError:
 # ========================== General purpose vals to describe our current 
platform ==========================
 is_windows = sys.platform.startswith('win32')
 is_macos = sys.platform.startswith('darwin')
-is_pypy = "PyPy" in sys.version
 is_supported_platform = sys.platform != "cli" and not 
sys.platform.startswith("java")
 is_supported_arch = sys.byteorder != "big"
 is_supported = is_supported_platform and is_supported_arch
@@ -47,15 +46,6 @@ The optional C extensions are not supported on big-endian 
systems.
 ===============================================================================
 """
 
-pypy_unsupported_msg = \
-"""
-=================================================================================
-Some optional C extensions are not supported in PyPy. Only murmur3 will be 
built.
-=================================================================================
-"""
-
-if is_pypy:
-    sys.stderr.write(pypy_unsupported_msg)
 if not is_supported_platform:
     sys.stderr.write(platform_unsupported_msg)
 elif not is_supported_arch:
@@ -72,7 +62,7 @@ def key_or_false(k):
 
 try_murmur3 = key_or_false("build-murmur3-extension") and is_supported
 try_libev = key_or_false("build-libev-extension") and is_supported
-try_cython = key_or_false("build-cython-extensions") and is_supported and not 
is_pypy
+try_cython = key_or_false("build-cython-extensions") and is_supported
 
 build_concurrency = driver_project_data["build-concurrency"]
 
diff --git a/tests/__init__.py b/tests/__init__.py
index 9b8dd897..047da82c 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -16,8 +16,6 @@
 
 import unittest
 import logging
-import sys
-import socket
 import platform
 import os
 from concurrent.futures import ThreadPoolExecutor
@@ -70,4 +68,3 @@ def is_windows():
 
 
 notwindows = unittest.skipUnless(not is_windows(), "This test is not adequate 
for windows")
-notpypy = unittest.skipUnless(not platform.python_implementation() == 'PyPy', 
"This tests is not suitable for pypy")
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py
index 3b0103db..68593f3c 100644
--- a/tests/integration/__init__.py
+++ b/tests/integration/__init__.py
@@ -359,7 +359,6 @@ lessthandse51 = unittest.skipUnless(DSE_VERSION and 
DSE_VERSION < Version('5.1')
 lessthandse60 = unittest.skipUnless(DSE_VERSION and DSE_VERSION < 
Version('6.0'), "DSE version less than 6.0 required")
 lessthandse69 = unittest.skipUnless(DSE_VERSION and DSE_VERSION < 
Version('6.9'), "DSE version less than 6.9 required")
 
-pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test 
is skipped unless it's on PyPy")
 requiresmallclockgranularity = unittest.skipIf("Windows" in platform.system() 
or "asyncore" in EVENT_LOOP_MANAGER,
                                                "This test is not suitible for 
environments with large clock granularity")
 requiressimulacron = unittest.skipIf(SIMULACRON_JAR is None or 
CASSANDRA_VERSION < Version("2.1"), "Simulacron jar hasn't been specified or C* 
version is 2.0")
diff --git a/tests/integration/cqlengine/model/test_model.py 
b/tests/integration/cqlengine/model/test_model.py
index c2c49064..813308a7 100644
--- a/tests/integration/cqlengine/model/test_model.py
+++ b/tests/integration/cqlengine/model/test_model.py
@@ -22,7 +22,6 @@ from cassandra.cqlengine.management import sync_table, 
drop_table, create_keyspa
 from cassandra.cqlengine import models
 from cassandra.cqlengine.models import Model, ModelDefinitionException
 from uuid import uuid1
-from tests.integration import pypy
 from tests.integration.cqlengine.base import TestQueryUpdateModel
 
 class TestModel(unittest.TestCase):
@@ -180,9 +179,6 @@ class ModelOverWriteTest(unittest.TestCase):
         """
         Test to ensure overwriting of primary keys in model inheritance is 
allowed
 
-        This is currently only an issue in PyPy. When PYTHON-504 is introduced 
this should
-        be updated error out and warn the user
-
         @since 3.6.0
         @jira_ticket PYTHON-576
         @expected_result primary keys can be overwritten via inheritance
diff --git a/tests/unit/test_policies.py b/tests/unit/test_policies.py
index 90c9a4b3..beaa1c81 100644
--- a/tests/unit/test_policies.py
+++ b/tests/unit/test_policies.py
@@ -139,28 +139,18 @@ class RoundRobinPolicyTest(unittest.TestCase):
             threads.append(Thread(target=host_up))
             threads.append(Thread(target=host_down))
 
-        # make the GIL switch after every instruction, maximizing
-        # the chance of race conditions
-        check = '__pypy__' in sys.builtin_module_names
-        if check:
-            original_interval = sys.getcheckinterval()
-        else:
-            original_interval = sys.getswitchinterval()
+        # Significantly lower the switching interval in order to increase the
+        # chance of race conditions
+        original_interval = sys.getswitchinterval()
 
         try:
-            if check:
-                sys.setcheckinterval(0)
-            else:
-                sys.setswitchinterval(0.0001)
+            sys.setswitchinterval(0.0001)
             for t in threads:
                 t.start()
             for t in threads:
                 t.join()
         finally:
-            if check:
-                sys.setcheckinterval(original_interval)
-            else:
-                sys.setswitchinterval(original_interval)
+            sys.setswitchinterval(original_interval)
 
         if errors:
             self.fail("Saw errors: %s" % (errors,))
diff --git a/tox.ini b/tox.ini
index 5e64c4b3..179f7b42 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py{310,311,312,313,314},pypy
+envlist = py{310,311,312,313,314}
 
 [base]
 deps = pytest


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to