Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7eb7eff

Browse filesBrowse files
lesteveogrisel
andauthored
BLD Remove support for setuptools build (#29400)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
1 parent ab9f748 commit 7eb7eff
Copy full SHA for 7eb7eff
Expand file treeCollapse file tree

20 files changed

+32
-1081
lines changed

‎.codecov.yml

Copy file name to clipboardExpand all lines: .codecov.yml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ ignore:
3030
- "sklearn/_build_utils"
3131
- "sklearn/__check_build"
3232
- "sklearn/_min_dependencies.py"
33-
- "**/setup.py"
3433
- "**/conftest.py"

‎.coveragerc

Copy file name to clipboardExpand all lines: .coveragerc
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ omit =
66
*/sklearn/externals/*
77
*/sklearn/_build_utils/*
88
*/benchmarks/*
9-
**/setup.py

‎.github/workflows/wheels.yml

Copy file name to clipboardExpand all lines: .github/workflows/wheels.yml
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ jobs:
164164
CIBW_PRERELEASE_PYTHONS: ${{ matrix.prerelease_pythons }}
165165
CIBW_FREE_THREADED_SUPPORT: ${{ matrix.free_threaded_support }}
166166
CIBW_ENVIRONMENT: SKLEARN_SKIP_NETWORK_TESTS=1
167-
SKLEARN_BUILD_PARALLEL=3
168167
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
169168
CIBW_ARCHS: all
170169
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
@@ -216,8 +215,6 @@ jobs:
216215

217216
- name: Build source distribution
218217
run: bash build_tools/github/build_source.sh
219-
env:
220-
SKLEARN_BUILD_PARALLEL: 3
221218

222219
- name: Test source distribution
223220
run: bash build_tools/github/test_source.sh

‎Makefile

Copy file name to clipboardExpand all lines: Makefile
+3-12Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ all:
77
@echo "Please use 'make <target>' where <target> is one of"
88
@echo " dev build scikit-learn with Meson"
99
@echo " clean clean scikit-learn Meson build. Very rarely needed,"
10-
@echo " one use case is when switching back to setuptools"
11-
@echo " dev-setuptools build scikit-learn with setuptools (deprecated)"
12-
@echo " clean-setuptools clean scikit-learn setuptools build (deprecated)"
10+
@echo " since meson-python recompiles on import."
1311

1412
.PHONY: all
1513

@@ -23,14 +21,7 @@ clean: clean-meson
2321
clean-meson:
2422
pip uninstall -y scikit-learn
2523
# It seems in some cases removing the folder avoids weird compilation
26-
# errors (e.g. when switching from numpy>=2 to numpy<2). For some
24+
# errors (e.g. when switching from numpy>=2 to numpy<2). For some
2725
# reason ninja clean -C $(DEFAULT_MESON_BUILD_DIR) is not
28-
# enough
26+
# enough.
2927
rm -rf $(DEFAULT_MESON_BUILD_DIR)
30-
31-
dev-setuptools:
32-
$(PYTHON) setup.py build_ext -i
33-
34-
clean-setuptools:
35-
$(PYTHON) setup.py clean
36-
rm -rf dist

‎azure-pipelines.yml

Copy file name to clipboardExpand all lines: azure-pipelines.yml
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ jobs:
208208
SKLEARN_ENABLE_DEBUG_CYTHON_DIRECTIVES: '1'
209209
SKLEARN_RUN_FLOAT32_TESTS: '1'
210210
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '2' # non-default seed
211-
BUILD_WITH_SETUPTOOLS: 'true'
212211
# Linux environment to test the latest available dependencies.
213212
# It runs tests requiring lightgbm, pandas and PyAMG.
214213
pylatest_pip_openblas_pandas:
@@ -236,7 +235,7 @@ jobs:
236235
)
237236
matrix:
238237
debian_atlas_32bit:
239-
DOCKER_CONTAINER: 'i386/debian:11.2'
238+
DOCKER_CONTAINER: 'i386/debian:12'
240239
DISTRIB: 'debian-32'
241240
COVERAGE: "true"
242241
LOCK_FILE: './build_tools/azure/debian_atlas_32bit_lock.txt'

‎build_tools/azure/install.sh

Copy file name to clipboardExpand all lines: build_tools/azure/install.sh
+1-13Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ scikit_learn_install() {
107107
setup_ccache
108108
show_installed_libraries
109109

110-
# Set parallelism to 3 to overlap IO bound tasks with CPU bound tasks on CI
111-
# workers with 2 cores when building the compiled extensions of scikit-learn.
112-
export SKLEARN_BUILD_PARALLEL=3
113-
114110
if [[ "$UNAMESTR" == "Darwin" && "$SKLEARN_TEST_NO_OPENMP" == "true" ]]; then
115111
# Without openmp, we use the system clang. Here we use /usr/bin/ar
116112
# instead because llvm-ar errors
@@ -129,9 +125,7 @@ scikit_learn_install() {
129125
export LDFLAGS="$LDFLAGS -Wl,--sysroot=/"
130126
fi
131127

132-
if [[ "$BUILD_WITH_SETUPTOOLS" == "true" ]]; then
133-
python setup.py develop
134-
elif [[ "$PIP_BUILD_ISOLATION" == "true" ]]; then
128+
if [[ "$PIP_BUILD_ISOLATION" == "true" ]]; then
135129
# Check that pip can automatically build scikit-learn with the build
136130
# dependencies specified in pyproject.toml using an isolated build
137131
# environment:
@@ -143,12 +137,6 @@ scikit_learn_install() {
143137
# toolchain
144138
ADDITIONAL_PIP_OPTIONS='-Csetup-args=--vsenv'
145139
fi
146-
# TODO Always add --check-build-dependencies when all CI builds have
147-
# pip >= 22.1.1. At the time of writing, two CI builds (debian32_atlas and
148-
# ubuntu_atlas) have an older pip
149-
if pip install --help | grep check-build-dependencies; then
150-
ADDITIONAL_PIP_OPTIONS="$ADDITIONAL_PIP_OPTIONS --check-build-dependencies"
151-
fi
152140
# Use the pre-installed build dependencies and build directly in the
153141
# current environment.
154142
pip install --verbose --no-build-isolation --editable . $ADDITIONAL_PIP_OPTIONS

‎build_tools/azure/pymin_conda_defaults_openblas_environment.yml

Copy file name to clipboardExpand all lines: build_tools/azure/pymin_conda_defaults_openblas_environment.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ dependencies:
1515
- pytest
1616
- pytest-xdist
1717
- pillow
18+
- ninja
1819
- pytest-cov
1920
- coverage
2021
- ccache
2122
- pip
2223
- pip:
2324
- threadpoolctl==3.1.0 # min
25+
- meson-python==0.16.0 # min

‎build_tools/azure/pymin_conda_defaults_openblas_linux-64_conda.lock

Copy file name to clipboardExpand all lines: build_tools/azure/pymin_conda_defaults_openblas_linux-64_conda.lock
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generated by conda-lock.
22
# platform: linux-64
3-
# input_hash: 244b6a064d3785ea62baaf9436848821d153846b455c2976f5e811182e848c83
3+
# input_hash: e4db53ad2240ff5f57679dd93701c30b6712ac3a43ec04e18b74132f2948b4cd
44
@EXPLICIT
55
https://repo.anaconda.com/pkgs/main/linux-64/_libgcc_mutex-0.1-main.conda#c3473ff8bdb3d124ed5ff11ec380d6f9
66
https://repo.anaconda.com/pkgs/main/linux-64/blas-1.0-openblas.conda#9ddfcaef10d79366c90128f5dc444be8
@@ -28,6 +28,7 @@ https://repo.anaconda.com/pkgs/main/linux-64/libwebp-base-1.3.2-h5eee18b_0.conda
2828
https://repo.anaconda.com/pkgs/main/linux-64/libxcb-1.15-h7f8727e_0.conda#ada518dcadd6aaee9aae47ba9a671553
2929
https://repo.anaconda.com/pkgs/main/linux-64/lz4-c-1.9.4-h6a678d5_1.conda#2ee58861f2b92b868ce761abb831819d
3030
https://repo.anaconda.com/pkgs/main/linux-64/ncurses-6.4-h6a678d5_0.conda#5558eec6e2191741a92f832ea826251c
31+
https://repo.anaconda.com/pkgs/main/linux-64/ninja-base-1.10.2-hd09550d_5.conda#09dcbad622d58caaeefe46cd399f0a76
3132
https://repo.anaconda.com/pkgs/main/linux-64/openssl-3.0.14-h5eee18b_0.conda#37b6dad6aa49000a4230a9f0cad172f6
3233
https://repo.anaconda.com/pkgs/main/linux-64/xz-5.4.6-h5eee18b_1.conda#1562802f843297ee776a50b9329597ed
3334
https://repo.anaconda.com/pkgs/main/linux-64/zlib-1.2.13-h5eee18b_1.conda#92e42d8310108b0a440fb2e60b2b2a25
@@ -56,7 +57,7 @@ https://repo.anaconda.com/pkgs/main/linux-64/libclang-14.0.6-default_hc6dbbc7_1.
5657
https://repo.anaconda.com/pkgs/main/linux-64/libpq-12.17-hdbd6064_0.conda#6bed363e25859faff66bf546a11c10e8
5758
https://repo.anaconda.com/pkgs/main/linux-64/openjpeg-2.4.0-h9ca470c_1.conda#dfd4b36eb8ddaffeca0ab412de63c3e2
5859
https://repo.anaconda.com/pkgs/main/linux-64/python-3.9.19-h955ad1f_1.conda#4b453281859c293c9d577271f3b18a0d
59-
https://repo.anaconda.com/pkgs/main/linux-64/certifi-2024.6.2-py39h06a4308_0.conda#738daf43271605d7291ecae0e8cac41c
60+
https://repo.anaconda.com/pkgs/main/linux-64/certifi-2024.7.4-py39h06a4308_0.conda#add87fa3b69a43e4e9ea1e619b267c4b
6061
https://repo.anaconda.com/pkgs/main/noarch/cycler-0.11.0-pyhd3eb1b0_0.conda#f5e365d2cdb66d547eb8c3ab93843aab
6162
https://repo.anaconda.com/pkgs/main/linux-64/cython-3.0.10-py39h5eee18b_0.conda#1419a658ed2b4d5c3ac1964f33143b64
6263
https://repo.anaconda.com/pkgs/main/linux-64/exceptiongroup-1.2.0-py39h06a4308_0.conda#960e2cb83ac5134df8e593a130aa11af
@@ -66,6 +67,7 @@ https://repo.anaconda.com/pkgs/main/noarch/iniconfig-1.1.1-pyhd3eb1b0_0.tar.bz2#
6667
https://repo.anaconda.com/pkgs/main/linux-64/joblib-1.2.0-py39h06a4308_0.conda#ac1f5687d70aa1128cbecb26bc9e559d
6768
https://repo.anaconda.com/pkgs/main/linux-64/kiwisolver-1.4.4-py39h6a678d5_0.conda#3d57aedbfbd054ce57fb3c1e4448828c
6869
https://repo.anaconda.com/pkgs/main/linux-64/mysql-5.7.24-h721c034_2.conda#dfc19ca2466d275c4c1f73b62c57f37b
70+
https://repo.anaconda.com/pkgs/main/linux-64/ninja-1.10.2-h06a4308_5.conda#6fc219bbc4c8dbb9060b5b7fe31ae83d
6971
https://repo.anaconda.com/pkgs/main/linux-64/numpy-base-1.21.6-py39h375b286_1.conda#0061d9193658774ab79fc85d143a94fc
7072
https://repo.anaconda.com/pkgs/main/linux-64/packaging-24.1-py39h06a4308_0.conda#e80d41ffc9450162ef10cbbb9b4ec7e9
7173
https://repo.anaconda.com/pkgs/main/linux-64/pillow-10.3.0-py39h5eee18b_0.conda#b346d6c71267c1553b6c18d3db5fdf6d
@@ -96,4 +98,7 @@ https://repo.anaconda.com/pkgs/main/linux-64/pyamg-4.2.3-py39h79cecc1_0.conda#af
9698
https://repo.anaconda.com/pkgs/main/linux-64/qt-main-5.15.2-h53bd1ea_10.conda#bd0c79e82df6323f638bdcb871891b61
9799
https://repo.anaconda.com/pkgs/main/linux-64/pyqt-5.15.10-py39h6a678d5_0.conda#52da5ff9b1144b078d2f41bab0b213f2
98100
https://repo.anaconda.com/pkgs/main/linux-64/matplotlib-3.3.4-py39h06a4308_0.conda#384fc5e01ebfcf30e7161119d3029b5a
101+
# pip meson @ https://files.pythonhosted.org/packages/44/b2/d4433391a7c5e94a39b50ca7295a8ceba736e7c72c455752a60122f52453/meson-1.4.1-py3-none-any.whl#sha256=d5acc3abae2dad3c70ddcbd10acac92b78b144d34d43f40f5b8ac31dfd8a826a
99102
# pip threadpoolctl @ https://files.pythonhosted.org/packages/61/cf/6e354304bcb9c6413c4e02a747b600061c21d38ba51e7e544ac7bc66aecc/threadpoolctl-3.1.0-py3-none-any.whl#sha256=8b99adda265feb6773280df41eece7b2e6561b772d21ffd52e372f999024907b
103+
# pip pyproject-metadata @ https://files.pythonhosted.org/packages/aa/5f/bb5970d3d04173b46c9037109f7f05fc8904ff5be073ee49bb6ff00301bc/pyproject_metadata-0.8.0-py3-none-any.whl#sha256=ad858d448e1d3a1fb408ac5bac9ea7743e7a8bbb472f2693aaa334d2db42f526
104+
# pip meson-python @ https://files.pythonhosted.org/packages/91/c0/104cb6244c83fe6bc3886f144cc433db0c0c78efac5dc00e409a5a08c87d/meson_python-0.16.0-py3-none-any.whl#sha256=842dc9f5dc29e55fc769ff1b6fe328412fe6c870220fc321060a1d2d395e69e8

‎build_tools/circle/build_doc.sh

Copy file name to clipboardExpand all lines: build_tools/circle/build_doc.sh
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ conda activate $CONDA_ENV_NAME
176176

177177
show_installed_libraries
178178

179-
# Set parallelism to 3 to overlap IO bound tasks with CPU bound tasks on CI
180-
# workers with 2 cores when building the compiled extensions of scikit-learn.
181-
export SKLEARN_BUILD_PARALLEL=3
182179
pip install -e . --no-build-isolation
183180

184181
echo "ccache build summary:"

‎build_tools/cirrus/arm_wheel.yml

Copy file name to clipboardExpand all lines: build_tools/cirrus/arm_wheel.yml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ linux_arm64_wheel_task:
88
memory: 4G
99
env:
1010
CIBW_ENVIRONMENT: SKLEARN_SKIP_NETWORK_TESTS=1
11-
SKLEARN_BUILD_PARALLEL=5
1211
CIBW_TEST_COMMAND: bash {project}/build_tools/wheels/test_wheels.sh
1312
CIBW_TEST_REQUIRES: pytest pandas threadpoolctl pytest-xdist
1413
CIBW_BUILD_VERBOSITY: 1

‎build_tools/cirrus/build_test_arm.sh

Copy file name to clipboardExpand all lines: build_tools/cirrus/build_test_arm.sh
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ setup_ccache
3737

3838
python --version
3939

40-
# Set parallelism to $N_CORES + 1 to overlap IO bound tasks with CPU bound tasks on CI
41-
# workers with $N_CORES cores when building the compiled extensions of scikit-learn.
42-
export SKLEARN_BUILD_PARALLEL=$(($N_CORES + 1))
43-
4440
# Disable the build isolation and build in the tree so that the same folder can be
4541
# cached between CI runs.
4642
pip install --verbose --no-build-isolation .

‎build_tools/update_environments_and_lock_files.py

Copy file name to clipboardExpand all lines: build_tools/update_environments_and_lock_files.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def remove_from(alist, to_remove):
179179
"channels": ["defaults"],
180180
"conda_dependencies": remove_from(
181181
common_dependencies,
182-
["pandas", "threadpoolctl", "pip", "ninja", "meson-python"],
182+
["pandas", "threadpoolctl", "pip", "meson-python"],
183183
)
184184
+ ["ccache"],
185185
"package_constraints": {
@@ -191,10 +191,11 @@ def remove_from(alist, to_remove):
191191
"cython": "min",
192192
"joblib": "min",
193193
"threadpoolctl": "min",
194+
"meson-python": "min",
194195
},
195196
# TODO: put pip dependencies back to conda dependencies when required
196197
# version is available on the defaults channel.
197-
"pip_dependencies": ["threadpoolctl"],
198+
"pip_dependencies": ["threadpoolctl", "meson-python"],
198199
},
199200
{
200201
"name": "pymin_conda_forge_openblas_ubuntu_2204",

‎doc/whats_new/v1.6.rst

Copy file name to clipboardExpand all lines: doc/whats_new/v1.6.rst
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ more details.
8989
passed to the underlying estimators via their respective methods.
9090
:pr:`28494` by :user:`Adam Li <adam2392>`.
9191

92+
Dropping support for building with setuptools
93+
---------------------------------------------
94+
95+
From scikit-learn 1.6 onwards, support for building with setuptools has been
96+
removed. Meson is the only supported way to build scikit-learn, see
97+
:ref:`Building from source <install_bleeding_edge>` for more details.
98+
99+
:pr:`29400` by :user:`Loïc Estève <lesteve>`
100+
92101
Dropping official support for PyPy
93102
----------------------------------
94103

‎maint_tools/check_pxd_in_installation.py

Copy file name to clipboardExpand all lines: maint_tools/check_pxd_in_installation.py
-60Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.