Skip to content

DOC update documentation on re-building Cython extensions #26334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions doc/developers/advanced_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ feature, code or documentation improvement).

.. prompt:: bash $

pip install --verbose --no-build-isolation --editable .
pip install --verbose --no-use-pep517 --no-build-isolation --editable .

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

.. note::

You will have to run the ``pip install --no-build-isolation --editable .``
You will have to run the ``pip install -v --no-use-pep517 --no-build-isolation -e .``
command every time the source code of a Cython file is updated
(ending in `.pyx` or `.pxd`). Use the ``--no-build-isolation`` flag to
avoid compiling the whole project each time, only the files you have
(ending in `.pyx` or `.pxd`). This can happen when you edit them or when you
use certain git commands such as `git pull`. Use the ``--no-build-isolation`` flag
to avoid compiling the whole project each time, only the files you have
modified.

Dependencies
Expand Down Expand Up @@ -179,8 +180,8 @@ Editable mode

If you run the development version, it is cumbersome to reinstall the package
each time you update the sources. Therefore it is recommended that you install
in with the ``pip install --no-build-isolation --editable .`` command, which
allows you to edit the code in-place. This builds the extension in place and
in with the ``pip install -v --no-use-pep517 --no-build-isolation -e .`` command,
which allows you to edit the code in-place. This builds the extension in place and
creates a link to the development directory (see `the pip docs
<https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs>`_).

Expand Down Expand Up @@ -241,7 +242,7 @@ Finally, build scikit-learn from this command prompt:

.. prompt:: bash $

pip install --verbose --no-build-isolation --editable .
pip install --verbose --no-use-pep517 --no-build-isolation --editable .

.. _compiler_macos:

Expand Down Expand Up @@ -283,7 +284,7 @@ scikit-learn from source:
joblib threadpoolctl pytest compilers llvm-openmp
conda activate sklearn-dev
make clean
pip install --verbose --no-build-isolation --editable .
pip install --verbose --no-use-pep517 --no-build-isolation --editable .

.. note::

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

make clean
pip install --verbose --no-build-isolation --editable .
pip install --verbose --no-use-pep517 --no-build-isolation --editable .

.. _compiler_linux:

Expand Down Expand Up @@ -423,7 +424,7 @@ in the user folder using conda:
conda create -n sklearn-dev -c conda-forge python numpy scipy cython \
joblib threadpoolctl pytest compilers
conda activate sklearn-dev
pip install --verbose --no-build-isolation --editable .
pip install --verbose --no-use-pep517 --no-build-isolation --editable .

.. _compiler_freebsd:

Expand Down Expand Up @@ -452,7 +453,7 @@ Finally, build the package using the standard command:

.. prompt:: bash $

pip install --verbose --no-build-isolation --editable .
pip install --verbose --no-use-pep517 --no-build-isolation --editable .

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 Expand Up @@ -513,7 +514,7 @@ and environment variable as follows before calling the ``pip install`` or
``python setup.py build_ext`` commands::

export SKLEARN_BUILD_PARALLEL=3
pip install --verbose --no-build-isolation --editable .
pip install --verbose --no-use-pep517 --no-build-isolation --editable .

On a machine with 2 CPU cores, it can be beneficial to use a parallelism level
of 3 to overlap IO bound tasks (reading and writing files on disk) with CPU
Expand Down
2 changes: 1 addition & 1 deletion doc/developers/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ modifying code and submitting a PR:

.. prompt:: bash $

pip install --no-build-isolation -e .
pip install -v --no-use-pep517 --no-build-isolation -e .

Use the ``--no-build-isolation`` flag to avoid compiling the whole project
each time, only the files you have modified.
Expand Down