From 13bd82a997364034ccf17424eeca871e0aad0369 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 00:02:54 -0600 Subject: [PATCH 01/11] Basic updates --- CHANGELOG.rst | 16 ++++++++++++++++ README-dev.rst | 2 +- README.rst | 2 +- cassandra/__init__.py | 2 +- cassandra/scylla/cloud.py | 0 docs/index.rst | 2 +- docs/installation.rst | 4 ++-- setup.py | 5 ++++- tox.ini | 2 +- 9 files changed, 27 insertions(+), 8 deletions(-) delete mode 100644 cassandra/scylla/cloud.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 472881dbc5..2f5b6c795d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,19 @@ +3.29.0 +====== +December 19, 2023 + +Features +-------- +* Add support for Python 3.9 through 3.12, drop support for 3.7 (PYTHON-1283) +* Removal of dependency on six module (PR 1172) +* Raise explicit exception when we try to deserialize a vector with a subtype that isn’t constant size (PYTHON-1371) + +Others +------ +* Remove outdated Python pre-3.7 references (PR 1186) +* Removed backup(.bak) files (PR 1185) +* Fix doc typo in add_callbacks (PR 1177) + 3.28.0 ====== June 5, 2023 diff --git a/README-dev.rst b/README-dev.rst index bcc1777ac8..3aa39020fa 100644 --- a/README-dev.rst +++ b/README-dev.rst @@ -176,7 +176,7 @@ Use tee to capture logs and see them on your terminal:: Testing Multiple Python Versions -------------------------------- -If you want to test all of python 3.7, 3.8, and pypy, use tox (this is what +If you want to test all of python 3.8 through 3.12 (and pypy) use tox (this is what TravisCI runs):: tox diff --git a/README.rst b/README.rst index 47483f3881..98884008b0 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ DataStax Driver for Apache Cassandra A modern, `feature-rich `_ and highly-tunable Python client library for Apache Cassandra (2.1+) and DataStax Enterprise (4.7+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3. -The driver supports Python 3.7 and 3.8. +The driver supports Python 3.8 through 3.12. **Note:** DataStax products do not support big-endian systems. diff --git a/cassandra/__init__.py b/cassandra/__init__.py index 8d453f5975..f4c88c1c91 100644 --- a/cassandra/__init__.py +++ b/cassandra/__init__.py @@ -22,7 +22,7 @@ def emit(self, record): logging.getLogger('cassandra').addHandler(NullHandler()) -__version_info__ = (3, 28, 0) +__version_info__ = (3, 29, 0) __version__ = '.'.join(map(str, __version_info__)) diff --git a/cassandra/scylla/cloud.py b/cassandra/scylla/cloud.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/index.rst b/docs/index.rst index 6f34f249fb..2370ccefaf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,7 @@ A Python client driver for `Apache Cassandra® `_. This driver works exclusively with the Cassandra Query Language v3 (CQL3) and Cassandra's native protocol. Cassandra 2.1+ is supported, including DSE 4.7+. -The driver supports Python 3.7 and 3.8. +The driver supports Python 3.8 through 3.12. This driver is open source under the `Apache v2 License `_. diff --git a/docs/installation.rst b/docs/installation.rst index 17a4e63324..5cbb820bab 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -3,7 +3,7 @@ Installation Supported Platforms ------------------- -Python 3.7 and 3.8 are supported. Both CPython (the standard Python +Python 3.8 through 3.12 are supported. Both CPython (the standard Python implementation) and `PyPy `_ are supported and tested. Linux, OSX, and Windows are supported. @@ -26,7 +26,7 @@ To check if the installation was successful, you can run:: python -c 'import cassandra; print cassandra.__version__' -It should print something like "3.27.0". +It should print something like "3.29.0". .. _installation-datastax-graph: diff --git a/setup.py b/setup.py index 86e50e8b22..4316cba073 100644 --- a/setup.py +++ b/setup.py @@ -438,8 +438,11 @@ def run_setup(extensions): 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries :: Python Modules' diff --git a/tox.ini b/tox.ini index 7d4dfe898e..477527c0d5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38},pypy +envlist = py{38,39,310,311,312},pypy [base] deps = nose From ed6acfc7bf3752ad1480ee345fecea75b9e759dc Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 00:20:44 -0600 Subject: [PATCH 02/11] Doc updates to reflect new status of event loops in 3.12 --- docs/installation.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 5cbb820bab..e235f398fe 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -215,12 +215,15 @@ dependencies, then use install-option:: sudo pip install --install-option="--no-cython" +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. + libev support ^^^^^^^^^^^^^ -The driver currently uses Python's ``asyncore`` module for its default -event loop. For better performance, ``libev`` is also supported through -a C extension. - If you're on Linux, you should be able to install libev through a package manager. For example, on Debian/Ubuntu:: From 3c44b57a623490c56380d9daa9158aca8da9b8fb Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 00:20:58 -0600 Subject: [PATCH 03/11] Update Travis to test on all current Python versions --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dbabf61378..0bce48278e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,11 @@ sudo: false language: python python: - - "3.7" - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" env: - CASS_DRIVER_NO_CYTHON=1 From 889a794d86ea7a404d4d3d6d49621853dd92003c Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 09:53:48 -0600 Subject: [PATCH 04/11] Trying to update tox config (with attendant changes to requirements.txt) to enable Travis testing on newer Python versions --- test-requirements.txt | 4 ++-- tox.ini | 17 ++++++----------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 4ebb23df53..e3f8e1cac6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,9 +7,9 @@ pytz sure pure-sasl twisted[tls] -gevent>=1.0 +gevent eventlet cython>=0.20,<0.30 packaging -futurist; python_version >= '3.7' +futurist asynctest diff --git a/tox.ini b/tox.ini index 477527c0d5..b4a01e53df 100644 --- a/tox.ini +++ b/tox.ini @@ -2,22 +2,21 @@ envlist = py{38,39,310,311,312},pypy [base] -deps = nose - mock<=1.0.1 +deps = pynose + mock>1.1 packaging - cython + cython>=0.20,<0.30 eventlet - twisted <15.5.0 + gevent + twisted[tls] pure-sasl kerberos futurist - greenlet>=0.4.14,<0.4.17 + lz4 cryptography>=35.0 -lz4_dependency = py37,py38: lz4 [testenv] deps = {[base]deps} - {[base]lz4_dependency} setenv = LIBEV_EMBED=0 CARES_EMBED=0 @@ -28,8 +27,6 @@ commands = nosetests --verbosity=2 --no-path-adjustment {toxinidir}/tests/unit/ [testenv:gevent_loop] deps = {[base]deps} - {[base]lz4_dependency} - gevent>=1.4,<1.5 setenv = LIBEV_EMBED=0 CARES_EMBED=0 @@ -41,8 +38,6 @@ commands = [testenv:eventlet_loop] deps = {[base]deps} - {[base]lz4_dependency} - gevent>=1.4,<1.5 setenv = LIBEV_EMBED=0 CARES_EMBED=0 From 6c44ed33a493eed2d73f238217e99c15580ebc42 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 10:41:05 -0600 Subject: [PATCH 05/11] Update Travis config to Ubuntu Jammy in order to get access to Python 3.10 --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0bce48278e..7366f1f0c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: jammy sudo: false language: python @@ -6,8 +6,6 @@ python: - "3.8" - "3.9" - "3.10" - - "3.11" - - "3.12" env: - CASS_DRIVER_NO_CYTHON=1 From eb21e245361fa4de4d8beb3e0becb3c3b1a03a88 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 10:48:44 -0600 Subject: [PATCH 06/11] Additional Jammy fixes --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7366f1f0c2..5a483f9a03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ addons: apt: packages: - build-essential - - python-dev + - python3-dev - pypy-dev - libc-ares-dev - libev4 From fc6fca9cfb46bfa7253a455d44aa1f35f20dfcae Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 14:22:05 -0600 Subject: [PATCH 07/11] Fix for PYTHON-1373 --- tests/unit/test_cluster.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_cluster.py b/tests/unit/test_cluster.py index c5f5def082..d6e00407f7 100644 --- a/tests/unit/test_cluster.py +++ b/tests/unit/test_cluster.py @@ -14,6 +14,7 @@ import unittest import logging +import socket from mock import patch, Mock @@ -88,8 +89,9 @@ class ClusterTest(unittest.TestCase): def test_tuple_for_contact_points(self): cluster = Cluster(contact_points=[('localhost', 9045), ('127.0.0.2', 9046), '127.0.0.3'], port=9999) + localhost_addr = set([addr[0] for addr in [t for (_,_,_,_,t) in socket.getaddrinfo("localhost",80)]]) for cp in cluster.endpoints_resolved: - if cp.address in ('::1', '127.0.0.1'): + if cp.address in localhost_addr: self.assertEqual(cp.port, 9045) elif cp.address == '127.0.0.2': self.assertEqual(cp.port, 9046) From 05a8f50e7017e4ce0ec3bb83289dac70d237b65d Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Tue, 19 Dec 2023 17:07:11 -0600 Subject: [PATCH 08/11] Make twine happy by explicitly stating the long description content type --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4316cba073..386bdfb9af 100644 --- a/setup.py +++ b/setup.py @@ -413,6 +413,7 @@ def run_setup(extensions): version=__version__, description=' DataStax Driver for Apache Cassandra', long_description=long_description, + long_description_content_type='text/x-rst', url='http://github.com/datastax/python-driver', project_urls={ 'Documentation': 'https://docs.datastax.com/en/developer/python-driver/latest/', From 1f0fa93adcf5c97d9c49d556324f788f82e70762 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 20 Dec 2023 10:16:46 -0600 Subject: [PATCH 09/11] Update CHANGELOG.rst Co-authored-by: Emelia <105240296+emeliawilkinson24@users.noreply.github.com> --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2f5b6c795d..1af78bd428 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,7 +11,7 @@ Features Others ------ * Remove outdated Python pre-3.7 references (PR 1186) -* Removed backup(.bak) files (PR 1185) +* Remove backup(.bak) files (PR 1185) * Fix doc typo in add_callbacks (PR 1177) 3.28.0 From f3a0639f30daca4c70ebe6043bcad63384333a51 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 20 Dec 2023 10:17:09 -0600 Subject: [PATCH 10/11] Update CHANGELOG.rst Co-authored-by: Emelia <105240296+emeliawilkinson24@users.noreply.github.com> --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1af78bd428..a7780b4ade 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,7 +6,7 @@ Features -------- * Add support for Python 3.9 through 3.12, drop support for 3.7 (PYTHON-1283) * Removal of dependency on six module (PR 1172) -* Raise explicit exception when we try to deserialize a vector with a subtype that isn’t constant size (PYTHON-1371) +* Raise explicit exception when deserializing a vector with a subtype that isn’t a constant size (PYTHON-1371) Others ------ From 4b44382e0fe60060f6a7dfc258c73e7658e35f87 Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Wed, 20 Dec 2023 10:17:44 -0600 Subject: [PATCH 11/11] Update README-dev.rst Co-authored-by: Emelia <105240296+emeliawilkinson24@users.noreply.github.com> --- README-dev.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-dev.rst b/README-dev.rst index 3aa39020fa..adca510412 100644 --- a/README-dev.rst +++ b/README-dev.rst @@ -176,7 +176,7 @@ Use tee to capture logs and see them on your terminal:: Testing Multiple Python Versions -------------------------------- -If you want to test all of python 3.8 through 3.12 (and pypy) use tox (this is what +Use tox to test all of Python 3.8 through 3.12 and pypy (this is what TravisCI runs):: tox