Skip to content

Commit 35d31e3

Browse files
committed
docs: replace direct setup.py invocations with pip in installation guide
Replace all 'python setup.py install' instructions with 'pip install .' or 'pip install scylla-driver' equivalents. Replace setup.py-specific command-line flags (--no-cython, --no-extensions, etc.) with their environment variable equivalents (CASS_DRIVER_NO_CYTHON, CASS_DRIVER_NO_EXTENSIONS, CASS_DRIVER_NO_LIBEV). Remove deprecated pip --install-option usage.
1 parent 632b7c2 commit 35d31e3

1 file changed

Lines changed: 12 additions & 21 deletions

File tree

docs/installation.rst

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ threads used to build the driver and any C extensions:
6262

6363
.. code-block:: bash
6464
65-
$ # installing from source
66-
$ CASS_DRIVER_BUILD_CONCURRENCY=8 python setup.py install
67-
$ # installing from pip
6865
$ CASS_DRIVER_BUILD_CONCURRENCY=8 pip install scylla-driver
6966
7067
Note that by default (when CASS_DRIVER_BUILD_CONCURRENCY is not specified), concurrency will be equal to the number of
@@ -108,7 +105,7 @@ installed. You can find the list of dependencies in
108105

109106
Once the dependencies are installed, simply run::
110107

111-
python setup.py install
108+
pip install .
112109

113110

114111
(*Optional*) Non-python Dependencies
@@ -122,9 +119,9 @@ for token-aware routing with the ``Murmur3Partitioner``,
122119
`libev <http://software.schmorp.de/pkg/libev.html>`_ event loop integration,
123120
and Cython optimized extensions.
124121

125-
When installing manually through setup.py, you can disable both with
126-
the ``--no-extensions`` option, or selectively disable them with
127-
with ``--no-murmur3``, ``--no-libev``, or ``--no-cython``.
122+
Extensions can be selectively disabled using environment variables:
123+
``CASS_DRIVER_NO_EXTENSIONS=1`` (disable all), ``CASS_DRIVER_NO_CYTHON=1``,
124+
or ``CASS_DRIVER_NO_LIBEV=1``.
128125

129126
To compile the extensions, ensure that GCC and the Python headers are available.
130127

@@ -149,31 +146,25 @@ This is not a hard requirement, but is engaged by default to build extensions of
149146
pure Python implementation.
150147

151148
This is a costly build phase, especially in clean environments where the Cython compiler must be built
152-
This build phase can be avoided using the build switch, or an environment variable::
149+
This build phase can be avoided using an environment variable::
153150

154-
python setup.py install --no-cython
151+
CASS_DRIVER_NO_CYTHON=1 pip install scylla-driver
155152

156-
Alternatively, an environment variable can be used to switch this option regardless of
153+
Alternatively, the environment variable can be used to switch this option regardless of
157154
context::
158155

159156
CASS_DRIVER_NO_CYTHON=1 <your script here>
160157
- or, to disable all extensions:
161158
CASS_DRIVER_NO_EXTENSIONS=1 <your script here>
162159

163-
This method is required when using pip, which provides no other way of injecting user options in a single command::
164-
165-
CASS_DRIVER_NO_CYTHON=1 pip install scylla-driver
166-
CASS_DRIVER_NO_CYTHON=1 sudo -E pip install ~/python-driver
167-
168-
The environment variable is the preferred option because it spans all invocations of setup.py, and will
160+
These environment variables are the preferred option, and will
169161
prevent Cython from being materialized as a setup requirement.
170162

171-
If your sudo configuration does not allow SETENV, you must push the option flag down via pip. However, pip
172-
applies these options to all dependencies (which break on the custom flag). Therefore, you must first install
173-
dependencies, then use install-option::
163+
If your sudo configuration does not allow SETENV, you must first install
164+
dependencies, then install the driver::
174165

175166
sudo pip install futures
176-
sudo pip install --install-option="--no-cython"
167+
sudo CASS_DRIVER_NO_CYTHON=1 pip install scylla-driver
177168

178169

179170
Supported Event Loops
@@ -205,7 +196,7 @@ install libev using any Windows package manager. For example, to install using
205196
$ vcpkg install libev
206197

207198
If successful, you should be able to build and install the extension
208-
(just using ``setup.py build`` or ``setup.py install``) and then use
199+
(just using ``pip install .``) and then use
209200
the libev event loop by doing the following:
210201

211202
.. code-block:: python

0 commit comments

Comments
 (0)