[ 
https://issues.apache.org/jira/browse/CASSPYTHON-3?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18047291#comment-18047291
 ] 

Bret McGuire commented on CASSPYTHON-3:
---------------------------------------

So this one has sent me down a rabbit hole or three.

 

As discussed on PYTHON-1428 the underlying problem here is that Cython isn't 
installed in the environment cibuildwheel is using to build wheels which in 
turn causes cythonized modules not to be built.  setup.py [leverages 
setup_requires|https://github.com/apache/cassandra-python-driver/blob/3.29.3/setup.py#L375-L387]
 to make sure Cython is available but this mechanism is known to be problematic 
so I'm guessing we simply lost support for it after we [bumped 
cibuildwheel|https://github.com/datastax/python-driver-wheels/commit/d5116de9aa458edd5a1c3f87e0cd299398736a4a]
 to get to Python 3.13 support (around the time of the 3.29.3 release).

 

There's no obvious replacement for setup_requires (i.e. a mechanism to say 
"make sure this dependency is installed for the build process only") so my next 
attempt was to tweak the cibuildwheel configs to make sure cython was 
installed.  Thing is cibuildwheel works with isolated environments; I could 
install cython globally but I couldn't find a way to make it impact the venv 
cibuildwheel was actually using.  So that came to nothing.

 

pyproject.toml has a way to specify build dependencies and in limited testing 
it looks like it might work.  We're also heading in that direction long-term as 
[PYTHON-1334|https://datastax-oss.atlassian.net/browse/PYTHON-1334] will 
confirm.  But moving to pyproject.toml (and changing the build interface) 
doesn't make sense for a patch release so we'd at least need a 3.30.0 here.  
And arguably this should move us to 4.0, although that feels a little extreme.

> No C extension .so files in published binary Python whl packages of 3.29.3
> --------------------------------------------------------------------------
>
>                 Key: CASSPYTHON-3
>                 URL: https://issues.apache.org/jira/browse/CASSPYTHON-3
>             Project: Apache Cassandra Python driver
>          Issue Type: Bug
>            Reporter: Bret McGuire
>            Priority: Normal
>
> Lifted version of 
> [PYTHON-1428|https://datastax-oss.atlassian.net/browse/PYTHON-1428].  
> Original description follows:
>  
> The published Python whl packags of 3.29.3 contain no C extension .so files, 
> so NumpyProtocolHandler cannot be used:
>  
> {noformat}
> >>> import cassandra.protocol ; cassandra.protocol.NumpyProtocolHandler is 
> >>> None
> True{noformat}
> For 3.29.2 it was OK:
>  
> {noformat}
> $ unzip -l 
> cassandra_driver-3.29.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
>  | grep '\.so$'
>    374976  2024-09-09 17:44   cassandra/query.cpython-311-x86_64-linux-gnu.so
>     14528  2024-09-09 17:44   
> cassandra/cmurmur3.cpython-311-x86_64-linux-gnu.so
>    560008  2024-09-09 17:44   
> cassandra/deserializers.cpython-311-x86_64-linux-gnu.so
>     23824  2024-09-09 17:44   
> cassandra/ioutils.cpython-311-x86_64-linux-gnu.so
>    219208  2024-09-09 17:44   
> cassandra/numpy_parser.cpython-311-x86_64-linux-gnu.so
>    236640  2024-09-09 17:44   
> cassandra/obj_parser.cpython-311-x86_64-linux-gnu.so
>     23792  2024-09-09 17:44   
> cassandra/cython_marshal.cpython-311-x86_64-linux-gnu.s
>    835688  2024-09-09 17:44   
> cassandra/connection.cpython-311-x86_64-linux-gnu.so
>    747976  2024-09-09 17:44   
> cassandra/cqltypes.cpython-311-x86_64-linux-gnu.so
>    868808  2024-09-09 17:44   cassandra/util.cpython-311-x86_64-linux-gnu.so
>    214056  2024-09-09 17:44   
> cassandra/parsing.cpython-311-x86_64-linux-gnu.so
>    193984  2024-09-09 17:44   
> cassandra/row_parser.cpython-311-x86_64-linux-gnu.so
>   1763432  2024-09-09 17:44   
> cassandra/metadata.cpython-311-x86_64-linux-gnu.so
>    758112  2024-09-09 17:44   
> cassandra/protocol.cpython-311-x86_64-linux-gnu.so
>    157984  2024-09-09 17:44   
> cassandra/concurrent.cpython-311-x86_64-linux-gnu.so
>     45664  2024-09-09 17:44   
> cassandra/bytesio.cpython-311-x86_64-linux-gnu.so
>   2013480  2024-09-09 17:44   
> cassandra/cluster.cpython-311-x86_64-linux-gnu.so
>     23600  2024-09-09 17:44   
> cassandra/cython_utils.cpython-311-x86_64-linux-gnu.so
>    440576  2024-09-09 17:44   cassandra/pool.cpython-311-x86_64-linux-gnu.so
>     30041  2024-09-09 17:44   
> cassandra/io/libevwrapper.cpython-311-x86_64-linux-gnu.so{noformat}
> But for 3.29.3 not anymore:
>  
> {noformat}
> $ unzip -l 
> cassandra_driver-3.29.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
>  | grep '\.so$'
>     14872  2025-10-22 00:13   
> cassandra/cmurmur3.cpython-311-x86_64-linux-gnu.so
>     34073  2025-10-22 00:13   
> cassandra/io/libevwrapper.cpython-311-x86_64-linux-gnu.so
> $ unzip -l 
> cassandra_driver-3.29.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
>  | grep '\.so$'
>     14872  2025-10-22 00:14   
> cassandra/cmurmur3.cpython-313-x86_64-linux-gnu.so
>     34073  2025-10-22 00:14   
> cassandra/io/libevwrapper.cpython-313-x86_64-linux-gnu.so{noformat}
> It works when self-compiling the package.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to