Skip to content

Commit a93d4f4

Browse files
committed
CASSPYTHON-14 Drop pypy support
patch by Bret McGuire; reviewed by Bret McGuire and Brad Schoening
1 parent c948fa1 commit a93d4f4

12 files changed

Lines changed: 14 additions & 64 deletions

File tree

‎README-dev.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ it with the ``PROTOCOL_VERSION`` environment variable::
9696

9797
Testing Multiple Python Versions
9898
--------------------------------
99-
Use tox to test all of Python 3.10 through 3.14 and pypy::
99+
Use tox to test all currently supported versions of the Python runtime::
100100

101101
tox
102102

‎cassandra/cmurmur3.c‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
#include <Python.h>
1515
#include <stdio.h>
1616

17-
#ifdef PYPY_VERSION
18-
#define COMPILING_IN_PYPY 1
19-
#define COMPILING_IN_CPYTHON 0
20-
#else
21-
#define COMPILING_IN_PYPY 0
22-
#define COMPILING_IN_CPYTHON 1
23-
#endif
2417
//-----------------------------------------------------------------------------
2518
// Platform-specific functions and macros
2619

@@ -179,13 +172,7 @@ struct module_state {
179172
PyObject *error;
180173
};
181174

182-
// pypy3 doesn't have GetState yet.
183-
#if COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
184175
#define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
185-
#else
186-
#define GETSTATE(m) (&_state)
187-
static struct module_state _state;
188-
#endif
189176

190177
static PyObject *
191178
murmur3(PyObject *self, PyObject *args)

‎cassandra/metadata.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,9 +1875,6 @@ class BytesToken(Token):
18751875
@classmethod
18761876
def from_string(cls, token_string):
18771877
""" `token_string` should be the string representation from the server. """
1878-
# unhexlify works fine with unicode input in everythin but pypy3, where it Raises "TypeError: 'str' does not support the buffer interface"
1879-
if isinstance(token_string, str):
1880-
token_string = token_string.encode('ascii')
18811878
# The BOP stores a hex string
18821879
return cls(unhexlify(token_string))
18831880

‎docs/installation.rst‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Installation
33

44
Supported Platforms
55
-------------------
6-
Python 3.10 through 3.14 are supported. Both CPython (the standard Python
7-
implementation) and `PyPy <http://pypy.org>`_ are supported and tested.
6+
Python 3.10 through 3.14 are supported. Linux, OSX, and Windows are supported.
87

9-
Linux, OSX, and Windows are supported.
8+
As of Python driver 4.0.0 only CPython is supported. Prior versions also explicitly supported PyPy but we no longer
9+
support this runtime. See `CASSPYTHON-14 <https://issues.apache.org/jira/browse/CASSPYTHON-14>`_ for additional information.
1010

1111
Installation through pip
1212
------------------------
@@ -18,7 +18,8 @@ the same time as the driver itself. To install the driver*::
1818

1919
You can use ``pip install --pre cassandra-driver`` if you need to install a beta version.
2020

21-
***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.
21+
***Note**: if intending to use optional extensions, install the `dependencies <#optional-non-python-dependencies>`_ first.
22+
The driver may need to be reinstalled if dependencies are added after the initial installation.
2223

2324
Verifying your Installation
2425
---------------------------

‎docs/performance.rst‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ provide this pattern with a synchronous API and tunable concurrency.
1717
Due to the GIL and limited concurrency, the driver can become CPU-bound pretty quickly. The sections below
1818
discuss further runtime and design considerations for mitigating this limitation.
1919

20-
PyPy
21-
----
22-
`PyPy <http://pypy.org>`_ is an alternative Python runtime which uses a JIT compiler to
23-
reduce CPU consumption. This leads to a huge improvement in the driver performance,
24-
more than doubling throughput for many workloads.
25-
2620
Cython Extensions
2721
-----------------
2822
`Cython <http://cython.org/>`_ is an optimizing compiler and language that can be used to compile the core files and

‎pyproject.toml‎

Lines changed: 1 addition & 2 deletions
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.1"
9-
dependencies = ['geomet>=1.1', "Deprecated>=1.3.1"]
9+
dependencies = ['geomet>=1.1']
1010
readme = "README.rst"
1111
authors = [{name = "DataStax"}]
1212
license = "Apache-2.0"
@@ -25,7 +25,6 @@ classifiers = [
2525
"Programming Language :: Python :: 3.13",
2626
"Programming Language :: Python :: 3.14",
2727
"Programming Language :: Python :: Implementation :: CPython",
28-
"Programming Language :: Python :: Implementation :: PyPy",
2928
"Topic :: Software Development :: Libraries :: Python Modules"
3029
]
3130

‎setup.py‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
# ========================== General purpose vals to describe our current platform ==========================
2828
is_windows = sys.platform.startswith('win32')
2929
is_macos = sys.platform.startswith('darwin')
30-
is_pypy = "PyPy" in sys.version
3130
is_supported_platform = sys.platform != "cli" and not sys.platform.startswith("java")
3231
is_supported_arch = sys.byteorder != "big"
3332
is_supported = is_supported_platform and is_supported_arch
@@ -47,15 +46,6 @@
4746
===============================================================================
4847
"""
4948

50-
pypy_unsupported_msg = \
51-
"""
52-
=================================================================================
53-
Some optional C extensions are not supported in PyPy. Only murmur3 will be built.
54-
=================================================================================
55-
"""
56-
57-
if is_pypy:
58-
sys.stderr.write(pypy_unsupported_msg)
5949
if not is_supported_platform:
6050
sys.stderr.write(platform_unsupported_msg)
6151
elif not is_supported_arch:
@@ -72,7 +62,7 @@ def key_or_false(k):
7262

7363
try_murmur3 = key_or_false("build-murmur3-extension") and is_supported
7464
try_libev = key_or_false("build-libev-extension") and is_supported
75-
try_cython = key_or_false("build-cython-extensions") and is_supported and not is_pypy
65+
try_cython = key_or_false("build-cython-extensions") and is_supported
7666

7767
build_concurrency = driver_project_data["build-concurrency"]
7868

‎tests/__init__.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
import unittest
1818
import logging
19-
import sys
20-
import socket
2119
import platform
2220
import os
2321
from concurrent.futures import ThreadPoolExecutor
@@ -70,4 +68,3 @@ def is_windows():
7068

7169

7270
notwindows = unittest.skipUnless(not is_windows(), "This test is not adequate for windows")
73-
notpypy = unittest.skipUnless(not platform.python_implementation() == 'PyPy', "This tests is not suitable for pypy")

‎tests/integration/__init__.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ def _id_and_mark(f):
359359
lessthandse60 = unittest.skipUnless(DSE_VERSION and DSE_VERSION < Version('6.0'), "DSE version less than 6.0 required")
360360
lessthandse69 = unittest.skipUnless(DSE_VERSION and DSE_VERSION < Version('6.9'), "DSE version less than 6.9 required")
361361

362-
pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy")
363362
requiresmallclockgranularity = unittest.skipIf("Windows" in platform.system() or "asyncore" in EVENT_LOOP_MANAGER,
364363
"This test is not suitible for environments with large clock granularity")
365364
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")

‎tests/integration/cqlengine/model/test_model.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from cassandra.cqlengine import models
2323
from cassandra.cqlengine.models import Model, ModelDefinitionException
2424
from uuid import uuid1
25-
from tests.integration import pypy
2625
from tests.integration.cqlengine.base import TestQueryUpdateModel
2726

2827
class TestModel(unittest.TestCase):
@@ -180,9 +179,6 @@ def test_model_over_write(self):
180179
"""
181180
Test to ensure overwriting of primary keys in model inheritance is allowed
182181
183-
This is currently only an issue in PyPy. When PYTHON-504 is introduced this should
184-
be updated error out and warn the user
185-
186182
@since 3.6.0
187183
@jira_ticket PYTHON-576
188184
@expected_result primary keys can be overwritten via inheritance

0 commit comments

Comments
 (0)