Skip to content

Commit 2de80e1

Browse files
committed
Merged latest changes from sklearn upstream 07/20/24
Signed-off-by: Adam Li <adam2392@gmail.com>
2 parents ae2604b + 63e1584 commit 2de80e1

File tree

116 files changed

+3066
-3378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3066
-3378
lines changed

.codecov.yml

Lines 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

Lines 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/cuda-gpu-ci.yml renamed to .github/workflows/cuda-ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
types:
88
- labeled
99

10-
# In order to remove the "CUDA CI" label we need to have write permissions for PRs
11-
permissions:
12-
pull-requests: write
13-
1410
jobs:
1511
tests:
1612
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
@@ -21,9 +17,6 @@ jobs:
2117
timeout-minutes: 20
2218
name: Run Array API unit tests
2319
steps:
24-
- uses: actions-ecosystem/action-remove-labels@v1
25-
with:
26-
labels: CUDA CI
2720
- uses: actions/setup-python@v5
2821
with:
2922
# XXX: The 3.12.4 release of Python on GitHub Actions is corrupted:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Remove "CUDA CI" Label
2+
3+
# This workflow removes the "CUDA CI" label that triggers the actual
4+
# CUDA CI. It is separate so that we can use the `pull_request_target`
5+
# trigger which has a API token with write access.
6+
on:
7+
pull_request_target:
8+
types:
9+
- labeled
10+
11+
# In order to remove the "CUDA CI" label we need to have write permissions for PRs
12+
permissions:
13+
pull-requests: write
14+
15+
jobs:
16+
label-remover:
17+
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
18+
name: Remove "CUDA CI" Label
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- uses: actions-ecosystem/action-remove-labels@v1
22+
with:
23+
labels: CUDA CI

.github/workflows/wheels.yml

Lines 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

MANIFEST.in

Lines changed: 0 additions & 36 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,21 @@ 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

1614
dev: dev-meson
1715

1816
dev-meson:
19-
pip install --verbose --no-build-isolation --editable . --check-build-dependencies --config-settings editable-verbose=true
17+
pip install --verbose --no-build-isolation --editable . --config-settings editable-verbose=true
2018

2119
clean: clean-meson
2220

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

asv_benchmarks/asv.conf.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
// Customizable commands for building, installing, and
2222
// uninstalling the project. See asv.conf.json documentation.
23-
//
24-
// "install_command": ["python -mpip install {wheel_file}"],
25-
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
26-
// "build_command": ["python -m build --wheel -o {build_cache_dir} {build_dir}"],
23+
"install_command": ["python -mpip install {wheel_file}"],
24+
"uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
25+
"build_command": ["python -m build --wheel -o {build_cache_dir} {build_dir}"],
26+
2727
// List of branches to benchmark. If not provided, defaults to "master
2828
// (for git) or "default" (for mercurial).
2929
"branches": ["main"],
@@ -72,12 +72,12 @@
7272
// those due to dependency changes.
7373
//
7474
"matrix": {
75-
"numpy": ["1.25.2"],
76-
"scipy": ["1.11.2"],
75+
"numpy": ["2.0.0"],
76+
"scipy": ["1.14.0"],
7777
"cython": ["3.0.10"],
7878
"joblib": ["1.3.2"],
7979
"threadpoolctl": ["3.2.0"],
80-
"pandas": ["2.1.0"]
80+
"pandas": ["2.2.2"]
8181
},
8282

8383
// Combinations of libraries/python versions can be excluded/included

azure-pipelines.yml

Lines 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

Lines 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/pylatest_pip_openblas_pandas_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
channels:
55
- defaults
66
dependencies:
7-
- python=3.9
7+
- python=3.11
88
- ccache
99
- pip
1010
- pip:

0 commit comments

Comments
 (0)