diff --git a/asv_benchmarks/asv.conf.json b/asv_benchmarks/asv.conf.json index 3392925d7a488..ba7b12011acec 100644 --- a/asv_benchmarks/asv.conf.json +++ b/asv_benchmarks/asv.conf.json @@ -23,11 +23,7 @@ // // "install_command": ["python -mpip install {wheel_file}"], // "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"], - // "build_command": [ - // "python setup.py build", - // "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}" - // ], - + // "build_command": ["python -m build --wheel -o {build_cache_dir} {build_dir}"], // List of branches to benchmark. If not provided, defaults to "master // (for git) or "default" (for mercurial). "branches": ["main"], diff --git a/doc/developers/advanced_installation.rst b/doc/developers/advanced_installation.rst index fe5c92107119d..bad6ccf9039ad 100644 --- a/doc/developers/advanced_installation.rst +++ b/doc/developers/advanced_installation.rst @@ -481,44 +481,3 @@ the base system and these steps will not be necessary. .. _virtualenv: https://docs.python.org/3/tutorial/venv.html .. _conda environment: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html .. _Miniforge3: https://github.com/conda-forge/miniforge#miniforge3 - -Alternative compilers -===================== - -The following command will build scikit-learn using your default C/C++ compiler. - -.. prompt:: bash $ - - pip install --editable . \ - --verbose --no-build-isolation \ - --config-settings editable-verbose=true - -If you want to build scikit-learn with another compiler handled by ``setuptools``, -use the following command: - -.. prompt:: bash $ - - python setup.py build_ext --compiler= -i build_clib --compiler= - -To see the list of available compilers run: - -.. prompt:: bash $ - - python setup.py build_ext --help-compiler - -If your compiler is not listed here, you can specify it through some environment -variables (does not work on windows). This `section -`_ -of the setuptools documentation explains in details which environment variables -are used by ``setuptools``, and at which stage of the compilation, to set the -compiler and linker options. - -When setting these environment variables, it is advised to first check their -``sysconfig`` counterparts variables and adapt them to your compiler. For instance:: - - import sysconfig - print(sysconfig.get_config_var('CC')) - print(sysconfig.get_config_var('LDFLAGS')) - -In addition, since Scikit-learn uses OpenMP, you need to include the appropriate OpenMP -flag of your compiler into the ``CFLAGS`` and ``CPPFLAGS`` environment variables. diff --git a/doc/developers/cython.rst b/doc/developers/cython.rst index 82022ddcbcc56..20cafd243f85b 100644 --- a/doc/developers/cython.rst +++ b/doc/developers/cython.rst @@ -97,8 +97,6 @@ Tips for performance * Inline methods and function when it makes sense -* Make sure your Cython compilation units `use NumPy recent C API `_. - * In doubt, read the generated C or C++ code if you can: "The fewer C instructions and indirections for a line of Cython code, the better" is a good rule of thumb. diff --git a/doc/developers/performance.rst b/doc/developers/performance.rst index 42687945a2bba..1565570bcdb28 100644 --- a/doc/developers/performance.rst +++ b/doc/developers/performance.rst @@ -72,20 +72,6 @@ following: parallelism** that is amenable to **multi-processing** by using the ``joblib.Parallel`` class. -When using Cython, use either - -.. prompt:: bash $ - - python setup.py build_ext -i - python setup.py install - -to generate C files. You are responsible for adding .c/.cpp extensions along -with build parameters in each submodule ``setup.py``. - -C/C++ generated files are embedded in distributed stable packages. The goal is -to make it possible to install scikit-learn stable version -on any machine with Python, Numpy, Scipy and C/C++ compiler. - .. _profiling-python-code: Profiling Python code diff --git a/sklearn/__check_build/__init__.py b/sklearn/__check_build/__init__.py index ad1a3a818b14d..f8a739b694579 100644 --- a/sklearn/__check_build/__init__.py +++ b/sklearn/__check_build/__init__.py @@ -38,8 +38,8 @@ def raise_build_error(e): It seems that scikit-learn has not been built correctly. If you have installed scikit-learn from source, please do not forget -to build the package before using it: run `python setup.py install` or -`make` in the source directory. +to build the package before using it. For detailed instructions, see: +https://scikit-learn.org/dev/developers/advanced_installation.html#building-from-source %s""" % (e, local_dir, "".join(dir_content).strip(), msg) ) diff --git a/sklearn/_loss/_loss.pyx.tp b/sklearn/_loss/_loss.pyx.tp index cdfea45058bb2..802ffdcc28c38 100644 --- a/sklearn/_loss/_loss.pyx.tp +++ b/sklearn/_loss/_loss.pyx.tp @@ -7,7 +7,7 @@ Template file to easily generate loops over samples using Tempita Generated file: _loss.pyx Each loss class is generated by a cdef functions on single samples. -The keywords between double braces are substituted in setup.py. +The keywords between double braces are substituted during the build. """ doc_HalfSquaredError = ( diff --git a/sklearn/ensemble/_gradient_boosting.pyx b/sklearn/ensemble/_gradient_boosting.pyx index c7acc6301edf1..cd9845a217c7d 100644 --- a/sklearn/ensemble/_gradient_boosting.pyx +++ b/sklearn/ensemble/_gradient_boosting.pyx @@ -9,7 +9,7 @@ from scipy.sparse import issparse from ..utils._typedefs cimport float32_t, float64_t, intp_t, int32_t, uint8_t # Note: _tree uses cimport numpy, cnp.import_array, so we need to include -# numpy headers, see setup.py. +# numpy headers in the build configuration of this extension from ..tree._tree cimport Node from ..tree._tree cimport Tree from ..tree._utils cimport safe_realloc diff --git a/sklearn/linear_model/_sag_fast.pyx.tp b/sklearn/linear_model/_sag_fast.pyx.tp index 29d537a45b897..2365211ab14f0 100644 --- a/sklearn/linear_model/_sag_fast.pyx.tp +++ b/sklearn/linear_model/_sag_fast.pyx.tp @@ -8,7 +8,7 @@ Template file for easily generate fused types consistent code using Tempita Generated file: sag_fast.pyx Each class is duplicated for all dtypes (float and double). The keywords -between double braces are substituted in setup.py. +between double braces are substituted during the build. Authors: Danny Sullivan Tom Dupre la Tour diff --git a/sklearn/linear_model/_sgd_fast.pyx.tp b/sklearn/linear_model/_sgd_fast.pyx.tp index e3f95dca55558..5869b2d3e64db 100644 --- a/sklearn/linear_model/_sgd_fast.pyx.tp +++ b/sklearn/linear_model/_sgd_fast.pyx.tp @@ -7,7 +7,7 @@ Template file to easily generate fused types consistent code using Tempita Generated file: _sgd_fast.pyx Each relevant function is duplicated for the dtypes float and double. -The keywords between double braces are substituted in setup.py. +The keywords between double braces are substituted during the build. Authors: Peter Prettenhofer Mathieu Blondel (partial_fit support) diff --git a/sklearn/utils/_seq_dataset.pxd.tp b/sklearn/utils/_seq_dataset.pxd.tp index 74e3f2457b953..9a15673353d2d 100644 --- a/sklearn/utils/_seq_dataset.pxd.tp +++ b/sklearn/utils/_seq_dataset.pxd.tp @@ -9,7 +9,7 @@ Template file for easily generate fused types consistent code using Tempita Generated file: _seq_dataset.pxd Each class is duplicated for all dtypes (float and double). The keywords -between double braces are substituted in setup.py. +between double braces are substituted during the build. """ # name_suffix, c_type diff --git a/sklearn/utils/_seq_dataset.pyx.tp b/sklearn/utils/_seq_dataset.pyx.tp index 78c97eeae5d20..ab7a49a80cb9c 100644 --- a/sklearn/utils/_seq_dataset.pyx.tp +++ b/sklearn/utils/_seq_dataset.pyx.tp @@ -8,7 +8,7 @@ Template file for easily generate fused types consistent code using Tempita Generated file: _seq_dataset.pyx Each class is duplicated for all dtypes (float and double). The keywords -between double braces are substituted in setup.py. +between double braces are substituted during the build. Author: Peter Prettenhofer Arthur Imbert diff --git a/sklearn/utils/_weight_vector.pxd.tp b/sklearn/utils/_weight_vector.pxd.tp index 075b0f5250d1b..bb1a4db486d2a 100644 --- a/sklearn/utils/_weight_vector.pxd.tp +++ b/sklearn/utils/_weight_vector.pxd.tp @@ -9,7 +9,7 @@ Template file for easily generate fused types consistent code using Tempita Generated file: weight_vector.pxd Each class is duplicated for all dtypes (float and double). The keywords -between double braces are substituted in setup.py. +between double braces are substituted during the build. """ # name_suffix, c_type diff --git a/sklearn/utils/_weight_vector.pyx.tp b/sklearn/utils/_weight_vector.pyx.tp index d95489749c677..d831a6f81c1da 100644 --- a/sklearn/utils/_weight_vector.pyx.tp +++ b/sklearn/utils/_weight_vector.pyx.tp @@ -9,7 +9,7 @@ Template file for easily generate fused types consistent code using Tempita Generated file: weight_vector.pxd Each class is duplicated for all dtypes (float and double). The keywords -between double braces are substituted in setup.py. +between double braces are substituted during the build. """ # name_suffix, c_type, reset_wscale_threshold