CASSANDRA-20997: Support Python 3.12 and 3.13 in cqlsh#4628
Open
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
Open
CASSANDRA-20997: Support Python 3.12 and 3.13 in cqlsh#4628arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support Python 3.12 and 3.13 in cqlsh by vendoring the pyasyncore package.
Context / Background
Currently, starting
cqlshwith Python 3.12 or 3.13 fails. Even if the version guards are relaxed, it crashes with aDependencyExceptionbecause Python 3.12 removed theasyncoremodule from the standard library (PEP 594). The bundled Datastax python driver (cassandra-driver-internal-only) relies onasyncoreas a default fallback event loop when C-extensions (libev) are not present, causing it to crash at import time.Changes Made
To fix this without modifying the bundled third-party driver's internal code:
.build/build-resolver.xmlto fetch the officialpyasyncorepackage from PyPI and package it as a.zipin thelib/directory.'pyasyncore-'to thethird_partiestuple inbin/cqlsh.pyso it gets injected intosys.pathat runtime (matching the existing approach forwcwidthandpure_sasl).bin/cqlshandbin/cqlsh.pyto allow Python up to 3.13.Testing
ant cqlshto verify thatpyasyncore-1.0.5-py3-none-any.zipis downloaded and copied to thelib/directory.cqlshlocally withCQLSH_PYTHON=python3.12andCQLSH_PYTHON=python3.13to confirm it successfully connects to the cluster without throwing driver import errors.patch by Arvind Kandpal; for CASSANDRA-20997