Skip to content

Commit d840f36

Browse files
lestevejeremiedbb
andauthored
MAINT Remove setup.py mentions from documentation and comments (scikit-learn#29352)
Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
1 parent 619a1c1 commit d840f36

File tree

13 files changed

+11
-72
lines changed

13 files changed

+11
-72
lines changed

asv_benchmarks/asv.conf.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323
//
2424
// "install_command": ["python -mpip install {wheel_file}"],
2525
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
26-
// "build_command": [
27-
// "python setup.py build",
28-
// "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
29-
// ],
30-
26+
// "build_command": ["python -m build --wheel -o {build_cache_dir} {build_dir}"],
3127
// List of branches to benchmark. If not provided, defaults to "master
3228
// (for git) or "default" (for mercurial).
3329
"branches": ["main"],

doc/developers/advanced_installation.rst

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -481,44 +481,3 @@ the base system and these steps will not be necessary.
481481
.. _virtualenv: https://docs.python.org/3/tutorial/venv.html
482482
.. _conda environment: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
483483
.. _Miniforge3: https://github.com/conda-forge/miniforge#miniforge3
484-
485-
Alternative compilers
486-
=====================
487-
488-
The following command will build scikit-learn using your default C/C++ compiler.
489-
490-
.. prompt:: bash $
491-
492-
pip install --editable . \
493-
--verbose --no-build-isolation \
494-
--config-settings editable-verbose=true
495-
496-
If you want to build scikit-learn with another compiler handled by ``setuptools``,
497-
use the following command:
498-
499-
.. prompt:: bash $
500-
501-
python setup.py build_ext --compiler=<compiler> -i build_clib --compiler=<compiler>
502-
503-
To see the list of available compilers run:
504-
505-
.. prompt:: bash $
506-
507-
python setup.py build_ext --help-compiler
508-
509-
If your compiler is not listed here, you can specify it through some environment
510-
variables (does not work on windows). This `section
511-
<https://setuptools.pypa.io/en/stable/userguide/ext_modules.html#compiler-and-linker-options>`_
512-
of the setuptools documentation explains in details which environment variables
513-
are used by ``setuptools``, and at which stage of the compilation, to set the
514-
compiler and linker options.
515-
516-
When setting these environment variables, it is advised to first check their
517-
``sysconfig`` counterparts variables and adapt them to your compiler. For instance::
518-
519-
import sysconfig
520-
print(sysconfig.get_config_var('CC'))
521-
print(sysconfig.get_config_var('LDFLAGS'))
522-
523-
In addition, since Scikit-learn uses OpenMP, you need to include the appropriate OpenMP
524-
flag of your compiler into the ``CFLAGS`` and ``CPPFLAGS`` environment variables.

doc/developers/cython.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ Tips for performance
9797

9898
* Inline methods and function when it makes sense
9999

100-
* Make sure your Cython compilation units `use NumPy recent C API <https://github.com/scikit-learn/scikit-learn/blob/62a017efa047e9581ae7df8bbaa62cf4c0544ee4/setup.py#L64-L70>`_.
101-
102100
* In doubt, read the generated C or C++ code if you can: "The fewer C instructions and indirections
103101
for a line of Cython code, the better" is a good rule of thumb.
104102

doc/developers/performance.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,6 @@ following:
7272
parallelism** that is amenable to **multi-processing** by using the
7373
``joblib.Parallel`` class.
7474

75-
When using Cython, use either
76-
77-
.. prompt:: bash $
78-
79-
python setup.py build_ext -i
80-
python setup.py install
81-
82-
to generate C files. You are responsible for adding .c/.cpp extensions along
83-
with build parameters in each submodule ``setup.py``.
84-
85-
C/C++ generated files are embedded in distributed stable packages. The goal is
86-
to make it possible to install scikit-learn stable version
87-
on any machine with Python, Numpy, Scipy and C/C++ compiler.
88-
8975
.. _profiling-python-code:
9076

9177
Profiling Python code

sklearn/__check_build/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def raise_build_error(e):
3838
It seems that scikit-learn has not been built correctly.
3939
4040
If you have installed scikit-learn from source, please do not forget
41-
to build the package before using it: run `python setup.py install` or
42-
`make` in the source directory.
41+
to build the package before using it. For detailed instructions, see:
42+
https://scikit-learn.org/dev/developers/advanced_installation.html#building-from-source
4343
%s"""
4444
% (e, local_dir, "".join(dir_content).strip(), msg)
4545
)

sklearn/_loss/_loss.pyx.tp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Template file to easily generate loops over samples using Tempita
77
Generated file: _loss.pyx
88

99
Each loss class is generated by a cdef functions on single samples.
10-
The keywords between double braces are substituted in setup.py.
10+
The keywords between double braces are substituted during the build.
1111
"""
1212

1313
doc_HalfSquaredError = (

sklearn/ensemble/_gradient_boosting.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ from scipy.sparse import issparse
99

1010
from ..utils._typedefs cimport float32_t, float64_t, intp_t, int32_t, uint8_t
1111
# Note: _tree uses cimport numpy, cnp.import_array, so we need to include
12-
# numpy headers, see setup.py.
12+
# numpy headers in the build configuration of this extension
1313
from ..tree._tree cimport Node
1414
from ..tree._tree cimport Tree
1515
from ..tree._utils cimport safe_realloc

sklearn/linear_model/_sag_fast.pyx.tp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Template file for easily generate fused types consistent code using Tempita
88
Generated file: sag_fast.pyx
99

1010
Each class is duplicated for all dtypes (float and double). The keywords
11-
between double braces are substituted in setup.py.
11+
between double braces are substituted during the build.
1212

1313
Authors: Danny Sullivan <dbsullivan23@gmail.com>
1414
Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>

sklearn/linear_model/_sgd_fast.pyx.tp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Template file to easily generate fused types consistent code using Tempita
77
Generated file: _sgd_fast.pyx
88

99
Each relevant function is duplicated for the dtypes float and double.
10-
The keywords between double braces are substituted in setup.py.
10+
The keywords between double braces are substituted during the build.
1111

1212
Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com>
1313
Mathieu Blondel (partial_fit support)

sklearn/utils/_seq_dataset.pxd.tp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Template file for easily generate fused types consistent code using Tempita
99
Generated file: _seq_dataset.pxd
1010

1111
Each class is duplicated for all dtypes (float and double). The keywords
12-
between double braces are substituted in setup.py.
12+
between double braces are substituted during the build.
1313
"""
1414

1515
# name_suffix, c_type

0 commit comments

Comments
 (0)