@@ -3,7 +3,7 @@ Installation
33
44Supported Platforms
55-------------------
6- Python 3.9 through 3.13 are supported. Both CPython (the standard Python
6+ Python 3.10 through 3.14 are supported. Both CPython (the standard Python
77implementation) and `PyPy <http://pypy.org >`_ are supported and tested.
88
99Linux, OSX, and Windows are supported.
@@ -26,7 +26,7 @@ To check if the installation was successful, you can run::
2626
2727 python -c 'import cassandra; print(cassandra.__version__)'
2828
29- It should print something like "3.29.3" .
29+ This command should print something like `` 3.30.0 `` .
3030
3131.. _installation-datastax-graph :
3232
@@ -62,8 +62,8 @@ just run ``apt-get install python-snappy``.)
6262(*Optional *) Metrics Support
6363----------------------------
6464The driver has built-in support for capturing :attr: `.Cluster.metrics ` about
65- the queries you run. However, the ``scales `` library is required to
66- support this ::
65+ the queries you run. Note that the ``scales `` module is required to
66+ support metrics. This module is available from Pypi and can be installed with ::
6767
6868 pip install scales
6969
@@ -91,23 +91,19 @@ details at `PYTHON-1351 <https://datastax-oss.atlassian.net/browse/PYTHON-1351>`
9191
9292Speeding Up Installation
9393^^^^^^^^^^^^^^^^^^^^^^^^
94-
9594By default, installing the driver through ``pip `` uses a pre-compiled, platform-specific wheel when available.
9695If using a source distribution rather than a wheel, Cython is used to compile certain parts of the driver.
9796This makes those hot paths faster at runtime, but the Cython compilation
9897process can take a long time -- as long as 10 minutes in some environments.
9998
10099In environments where performance is less important, it may be worth it to
101100:ref: `disable Cython as documented below <cython-extensions >`.
102- You can also use ``CASS_DRIVER_BUILD_CONCURRENCY `` to increase the number of
103- threads used to build the driver and any C extensions:
104-
105- .. code-block :: bash
106101
107- $ # installing from source
108- $ CASS_DRIVER_BUILD_CONCURRENCY=8 python setup.py install
109- $ # installing from pip
110- $ CASS_DRIVER_BUILD_CONCURRENCY=8 pip install cassandra-driver
102+ Cython also supports concurrent builds of native extensions. The ``build-concurrency `` key in the
103+ ``tool.cassandra-driver `` table of pyproject.toml is an integer value which specifies the number of
104+ concurrent builds Cython may execute. The value for this key must be a non-negative integer; the default is zero,
105+ indicating no concurrent builds. Note that Cython's concurrent builds use the standard ``multiprocessing `` package
106+ so this library must be availble is concurrent builds are used.
111107
112108OSX Installation Error
113109^^^^^^^^^^^^^^^^^^^^^^
@@ -147,8 +143,7 @@ installed. You can find the list of dependencies in
147143
148144Once the dependencies are installed, simply run::
149145
150- python setup.py install
151-
146+ pip install .
152147
153148(*Optional *) Non-python Dependencies
154149------------------------------------
@@ -161,9 +156,10 @@ for token-aware routing with the ``Murmur3Partitioner``,
161156`libev <http://software.schmorp.de/pkg/libev.html >`_ event loop integration,
162157and Cython optimized extensions.
163158
164- When installing manually through setup.py, you can disable both with
165- the ``--no-extensions `` option, or selectively disable them with
166- with ``--no-murmur3 ``, ``--no-libev ``, or ``--no-cython ``.
159+ Some or all of these native extensions can be disabled by changing the corresponding
160+ key in the ``tool.cassandra-driver `` table of pyproject.toml to ``false ``. Please consult
161+ the ``build-murmur3-extension ``, ``build-libev-extension `` and ``build-cython-extensions ``
162+ keys (respectively) to disable these extensions.
167163
168164To compile the extensions, ensure that GCC and the Python headers are available.
169165
@@ -184,36 +180,12 @@ See :ref:`windows_build` for notes on configuring the build environment on Windo
184180Cython-based Extensions
185181~~~~~~~~~~~~~~~~~~~~~~~
186182By default, this package uses `Cython <http://cython.org/ >`_ to optimize core modules and build custom extensions.
187- This is not a hard requirement, but is engaged by default to build extensions offering better performance than the
183+ This is not a hard requirement, but is enabled by default to build extensions offering better performance than the
188184pure Python implementation.
189185
190- This is a costly build phase, especially in clean environments where the Cython compiler must be built
191- This build phase can be avoided using the build switch, or an environment variable::
192-
193- python setup.py install --no-cython
194-
195- Alternatively, an environment variable can be used to switch this option regardless of
196- context::
197-
198- CASS_DRIVER_NO_CYTHON=1 <your script here>
199- - or, to disable all extensions:
200- CASS_DRIVER_NO_EXTENSIONS=1 <your script here>
201-
202- This method is required when using pip, which provides no other way of injecting user options in a single command::
203-
204- CASS_DRIVER_NO_CYTHON=1 pip install cassandra-driver
205- CASS_DRIVER_NO_CYTHON=1 sudo -E pip install ~/python-driver
206-
207- The environment variable is the preferred option because it spans all invocations of setup.py, and will
208- prevent Cython from being materialized as a setup requirement.
209-
210- If your sudo configuration does not allow SETENV, you must push the option flag down via pip. However, pip
211- applies these options to all dependencies (which break on the custom flag). Therefore, you must first install
212- dependencies, then use install-option::
213-
214- sudo pip install futures
215- sudo pip install --install-option="--no-cython"
216-
186+ This process does take some time, however, so if you wish to build without generating these extensions using
187+ Cython you can do so by changing the ``build-cython-extensions `` key in the ``tool.cassandra-driver `` table of pyproject.toml.
188+ By default this key is set to ``true ``; simply changing it to ``false `` will disable all Cython functionality.
217189
218190Supported Event Loops
219191^^^^^^^^^^^^^^^^^^^^^
@@ -250,7 +222,7 @@ install libev using any Windows package manager. For example, to install using
250222 $ vcpkg install libev
251223
252224If successful, you should be able to build and install the extension
253- (just using ``setup.py build `` or ``setup.py install ``) and then use
225+ (just using ``pip install `` or ``pip install -e ``) and then use
254226the libev event loop by doing the following:
255227
256228.. code-block :: python
0 commit comments