Skip to content

Commit

Permalink
Update doc to use spin install -v
Browse files Browse the repository at this point in the history
  • Loading branch information
lesteve committed Jul 16, 2024
1 parent cf25c7d commit fbdcf68
Showing 1 changed file with 14 additions and 35 deletions.
49 changes: 14 additions & 35 deletions doc/developers/advanced_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ feature, code or documentation improvement).

.. prompt:: bash $

conda create -n sklearn-env -c conda-forge python numpy scipy cython meson-python ninja
conda create -n sklearn-env -c conda-forge python numpy scipy cython meson-python ninja spin

It is not always necessary but it is safer to open a new prompt before
activating the newly created conda environment.
Expand All @@ -87,7 +87,7 @@ feature, code or documentation improvement).

python3 -m venv sklearn-env
source sklearn-env/bin/activate
pip install wheel numpy scipy cython meson-python ninja
pip install wheel numpy scipy cython meson-python ninja spin

#. Install a compiler with OpenMP_ support for your platform. See instructions
for :ref:`compiler_windows`, :ref:`compiler_macos`, :ref:`compiler_linux`
Expand All @@ -97,9 +97,7 @@ feature, code or documentation improvement).

.. prompt:: bash $

pip install --editable . \
--verbose --no-build-isolation \
--config-settings editable-verbose=true
spin install -v

#. Check that the installed scikit-learn has a version number ending with
`.dev0`:
Expand All @@ -113,14 +111,9 @@ feature, code or documentation improvement).

.. note::

`--config-settings editable-verbose=true` is optional but recommended
to avoid surprises when you import `sklearn`. `meson-python` implements
editable installs by rebuilding `sklearn` when executing `import sklearn`.
With the recommended setting you will see a message when this happens,
rather than potentially waiting without feed-back and wondering
what is taking so long. Bonus: this means you only have to run the `pip
install` command once, `sklearn` will automatically be rebuilt when
importing `sklearn`.
You only have to run the `spin` command once. You can then run the tests
with pytest and import `sklearn` will automatically rebuild `sklearn` as
needed.

Dependencies
------------
Expand Down Expand Up @@ -236,9 +229,7 @@ Finally, build scikit-learn with this command prompt:

.. prompt:: bash $

pip install --editable . \
--verbose --no-build-isolation \
--config-settings editable-verbose=true
spin install -v

.. _compiler_macos:

Expand Down Expand Up @@ -284,11 +275,7 @@ activating the newly created conda environment.

.. prompt:: bash $

conda activate sklearn-dev
make clean
pip install --editable . \
--verbose --no-build-isolation \
--config-settings editable-verbose=true
spin install -v

.. note::

Expand Down Expand Up @@ -362,9 +349,7 @@ Finally, build scikit-learn in verbose mode (to check for the presence of the
.. prompt:: bash $

make clean
pip install --editable . \
--verbose --no-build-isolation \
--config-settings editable-verbose=true
spin install -v

.. _compiler_linux:

Expand All @@ -389,10 +374,8 @@ then proceed as usual:

.. prompt:: bash $

pip3 install cython
pip3 install --editable . \
--verbose --no-build-isolation \
--config-settings editable-verbose=true
pip3 install cython spin
spin install -v

Cython and the pre-compiled wheels for the runtime dependencies (numpy, scipy
and joblib) should automatically be installed in
Expand Down Expand Up @@ -424,17 +407,15 @@ in the user folder using conda:
.. prompt:: bash $

conda create -n sklearn-dev -c conda-forge python numpy scipy cython \
joblib threadpoolctl pytest compilers meson-python ninja
joblib threadpoolctl pytest compilers meson-python ninja spin

It is not always necessary but it is safer to open a new prompt before
activating the newly created conda environment.

.. prompt:: bash $

conda activate sklearn-dev
pip install --editable . \
--verbose --no-build-isolation \
--config-settings editable-verbose=true
spin install -v

.. _compiler_freebsd:

Expand Down Expand Up @@ -463,9 +444,7 @@ Finally, build the package using the standard command:

.. prompt:: bash $

pip install --editable . \
--verbose --no-build-isolation \
--config-settings editable-verbose=true
spin install -v

For the upcoming FreeBSD 12.1 and 11.3 versions, OpenMP will be included in
the base system and these steps will not be necessary.
Expand Down

0 comments on commit fbdcf68

Please sign in to comment.