Skip to content

Commit 971c41d

Browse files
committed
Merging main 080724
Signed-off-by: Adam Li <adam2392@gmail.com>
2 parents 2de80e1 + 5600faa commit 971c41d

File tree

473 files changed

+3834
-2792
lines changed

Some content is hidden

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

473 files changed

+3834
-2792
lines changed

.github/workflows/cuda-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
run: |
4343
source "${HOME}/conda/etc/profile.d/conda.sh"
4444
conda activate sklearn
45-
pytest -k 'array_api'
45+
SCIPY_ARRAY_API=1 pytest -k 'array_api'

.github/workflows/wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ jobs:
174174
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--vsenv"
175175
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir}
176176
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }}
177-
CIBW_TEST_REQUIRES: pytest
178177
CIBW_BEFORE_TEST: bash {project}/build_tools/wheels/cibw_before_test.sh
178+
CIBW_TEST_REQUIRES: pytest pandas
179179
CIBW_TEST_COMMAND: bash {project}/build_tools/wheels/test_wheels.sh
180180
CIBW_TEST_COMMAND_WINDOWS: bash {project}/build_tools/github/test_windows_wheels.sh ${{ matrix.python }}
181181
CIBW_BUILD_VERBOSITY: 1

.gitignore

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ doc/css/*
2121
!doc/css/.gitkeep
2222
doc/modules/generated/
2323
doc/datasets/generated/
24+
doc/developers/maintainer.rst
2425
doc/index.rst
2526
doc/min_dependency_table.rst
2627
doc/min_dependency_substitutions.rst
@@ -87,31 +88,5 @@ _configtest.o.d
8788
# virtualenv from advanced installation guide
8889
sklearn-env/
8990

90-
# files generated from a template
91-
sklearn/_loss/_loss.pyx
92-
sklearn/utils/_seq_dataset.pyx
93-
sklearn/utils/_seq_dataset.pxd
94-
sklearn/utils/_weight_vector.pyx
95-
sklearn/utils/_weight_vector.pxd
96-
sklearn/linear_model/_sag_fast.pyx
97-
sklearn/linear_model/_sgd_fast.pyx
98-
sklearn/metrics/_dist_metrics.pyx
99-
sklearn/metrics/_dist_metrics.pxd
100-
sklearn/metrics/_pairwise_distances_reduction/_argkmin.pxd
101-
sklearn/metrics/_pairwise_distances_reduction/_argkmin.pyx
102-
sklearn/metrics/_pairwise_distances_reduction/_argkmin_classmode.pyx
103-
sklearn/metrics/_pairwise_distances_reduction/_base.pxd
104-
sklearn/metrics/_pairwise_distances_reduction/_base.pyx
105-
sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pxd
106-
sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pyx
107-
sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pxd
108-
sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pyx
109-
sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pxd
110-
sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pyx
111-
sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors_classmode.pyx
112-
sklearn/neighbors/_ball_tree.pyx
113-
sklearn/neighbors/_binary_tree.pxi
114-
sklearn/neighbors/_kd_tree.pyx
115-
11691
# Default JupyterLite content
11792
jupyterlite_contents

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: trailing-whitespace
88
- repo: https://github.com/astral-sh/ruff-pre-commit
99
# Ruff version.
10-
rev: v0.2.1
10+
rev: v0.5.1
1111
hooks:
1212
- id: ruff
1313
args: ["--fix", "--output-format=full"]

.spin/cmds.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import shutil
2+
import sys
3+
4+
import click
5+
from spin.cmds import util
6+
7+
8+
@click.command()
9+
def clean():
10+
"""🪥 Clean build folder.
11+
12+
Very rarely needed since meson-python recompiles as needed when sklearn is
13+
imported.
14+
15+
One known use case where "spin clean" is useful: avoid compilation errors
16+
when switching from numpy<2 to numpy>=2 in the same conda environment or
17+
virtualenv.
18+
"""
19+
util.run([sys.executable, "-m", "pip", "uninstall", "scikit-learn", "-y"])
20+
default_meson_build_dir = (
21+
f"build/cp{sys.version_info.major}{sys.version_info.minor}"
22+
)
23+
click.secho(
24+
f"removing default Meson build dir: {default_meson_build_dir}",
25+
bold=True,
26+
fg="bright_blue",
27+
)
28+
29+
shutil.rmtree(default_meson_build_dir, ignore_errors=True)

azure-pipelines.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ jobs:
138138
# Here we make sure, that they are still run on a regular basis.
139139
${{ if eq(variables['Build.Reason'], 'Schedule') }}:
140140
SKLEARN_SKIP_NETWORK_TESTS: '0'
141+
SCIPY_ARRAY_API: '1'
141142

142143
# Check compilation with Ubuntu 22.04 LTS (Jammy Jellyfish) and scipy from conda-forge
143144
# By default the CI is sequential, where `Ubuntu_Jammy_Jellyfish` runs first and
@@ -197,10 +198,10 @@ jobs:
197198
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
198199
)
199200
matrix:
200-
# Linux + Python 3.9 build with OpenBLAS and without pandas
201-
pymin_conda_defaults_openblas:
201+
# Linux + Python 3.9 build with minimum supported version of dependencies
202+
pymin_conda_forge_openblas_min_dependencies:
202203
DISTRIB: 'conda'
203-
LOCK_FILE: './build_tools/azure/pymin_conda_defaults_openblas_linux-64_conda.lock'
204+
LOCK_FILE: './build_tools/azure/pymin_conda_forge_openblas_min_dependencies_linux-64_conda.lock'
204205
# Enable debug Cython directives to capture IndexError exceptions in
205206
# combination with the -Werror::pytest.PytestUnraisableExceptionWarning
206207
# flag for pytest.
@@ -221,6 +222,7 @@ jobs:
221222
# makes sure that they are single threaded in each xdist subprocess.
222223
PYTEST_XDIST_VERSION: 'none'
223224
PIP_BUILD_ISOLATION: 'true'
225+
SCIPY_ARRAY_API: '1'
224226

225227
- template: build_tools/azure/posix-docker.yml
226228
parameters:
@@ -259,6 +261,7 @@ jobs:
259261
DISTRIB: 'conda'
260262
LOCK_FILE: './build_tools/azure/pylatest_conda_forge_mkl_osx-64_conda.lock'
261263
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '5' # non-default seed
264+
SCIPY_ARRAY_API: '1'
262265
pylatest_conda_mkl_no_openmp:
263266
DISTRIB: 'conda'
264267
LOCK_FILE: './build_tools/azure/pylatest_conda_mkl_no_openmp_osx-64_conda.lock'

benchmarks/bench_kernel_pca_solvers_time_vs_n_components.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
of components (this takes more time).
3737
"""
3838

39-
# Authors: Sylvain MARIE, Schneider Electric
40-
4139
import time
4240

4341
import matplotlib.pyplot as plt

benchmarks/bench_plot_parallel_pairwise.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Authors: The scikit-learn developers
22
# SPDX-License-Identifier: BSD-3-Clause
3+
34
import time
45

56
import matplotlib.pyplot as plt

build_tools/azure/debian_atlas_32bit_lock.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# pip-compile --output-file=build_tools/azure/debian_atlas_32bit_lock.txt build_tools/azure/debian_atlas_32bit_requirements.txt
66
#
7-
attrs==23.2.0
7+
attrs==24.1.0
88
# via pytest
9-
coverage==7.5.4
9+
coverage==7.6.1
1010
# via pytest-cov
1111
cython==3.0.10
1212
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
1313
iniconfig==2.0.0
1414
# via pytest
1515
joblib==1.2.0
1616
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
17-
meson==1.4.1
17+
meson==1.5.1
1818
# via meson-python
1919
meson-python==0.16.0
2020
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
@@ -40,6 +40,4 @@ pytest-cov==2.9.0
4040
threadpoolctl==3.1.0
4141
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
4242
tomli==2.0.1
43-
# via
44-
# meson-python
45-
# pytest
43+
# via pytest

build_tools/azure/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ python_environment_install_and_activate() {
8585
# install them from scientific-python-nightly-wheels
8686
dev_anaconda_url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
8787
dev_packages="numpy scipy Cython"
88-
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url $dev_packages
88+
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url $dev_packages --only-binary :all:
8989
fi
9090

9191
if [[ "$DISTRIB" == "conda-pip-scipy-dev" ]]; then
9292
echo "Installing development dependency wheels"
9393
dev_anaconda_url=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
9494
dev_packages="numpy scipy pandas Cython"
95-
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url $dev_packages
95+
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url $dev_packages --only-binary :all:
9696

9797
check_packages_dev_version $dev_packages
9898

0 commit comments

Comments
 (0)