Skip to content

Commit

Permalink
Merged latest changes from sklearn upstream 07/20/24
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Li <adam2392@gmail.com>
  • Loading branch information
adam2392 committed Jul 21, 2024
2 parents ae2604b + 63e1584 commit 2de80e1
Show file tree
Hide file tree
Showing 116 changed files with 3,066 additions and 3,378 deletions.
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ ignore:
- "sklearn/_build_utils"
- "sklearn/__check_build"
- "sklearn/_min_dependencies.py"
- "**/setup.py"
- "**/conftest.py"
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ omit =
*/sklearn/externals/*
*/sklearn/_build_utils/*
*/benchmarks/*
**/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
types:
- labeled

# In order to remove the "CUDA CI" label we need to have write permissions for PRs
permissions:
pull-requests: write

jobs:
tests:
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
Expand All @@ -21,9 +17,6 @@ jobs:
timeout-minutes: 20
name: Run Array API unit tests
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: CUDA CI
- uses: actions/setup-python@v5
with:
# XXX: The 3.12.4 release of Python on GitHub Actions is corrupted:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/cuda-label-remover.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Remove "CUDA CI" Label

# This workflow removes the "CUDA CI" label that triggers the actual
# CUDA CI. It is separate so that we can use the `pull_request_target`
# trigger which has a API token with write access.
on:
pull_request_target:
types:
- labeled

# In order to remove the "CUDA CI" label we need to have write permissions for PRs
permissions:
pull-requests: write

jobs:
label-remover:
if: contains(github.event.pull_request.labels.*.name, 'CUDA CI')
name: Remove "CUDA CI" Label
runs-on: ubuntu-20.04
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: CUDA CI
3 changes: 0 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ jobs:
CIBW_PRERELEASE_PYTHONS: ${{ matrix.prerelease_pythons }}
CIBW_FREE_THREADED_SUPPORT: ${{ matrix.free_threaded_support }}
CIBW_ENVIRONMENT: SKLEARN_SKIP_NETWORK_TESTS=1
SKLEARN_BUILD_PARALLEL=3
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_ARCHS: all
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
Expand Down Expand Up @@ -216,8 +215,6 @@ jobs:

- name: Build source distribution
run: bash build_tools/github/build_source.sh
env:
SKLEARN_BUILD_PARALLEL: 3

- name: Test source distribution
run: bash build_tools/github/test_source.sh
Expand Down
36 changes: 0 additions & 36 deletions MANIFEST.in

This file was deleted.

17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,21 @@ all:
@echo "Please use 'make <target>' where <target> is one of"
@echo " dev build scikit-learn with Meson"
@echo " clean clean scikit-learn Meson build. Very rarely needed,"
@echo " one use case is when switching back to setuptools"
@echo " dev-setuptools build scikit-learn with setuptools (deprecated)"
@echo " clean-setuptools clean scikit-learn setuptools build (deprecated)"
@echo " since meson-python recompiles on import."

.PHONY: all

dev: dev-meson

dev-meson:
pip install --verbose --no-build-isolation --editable . --check-build-dependencies --config-settings editable-verbose=true
pip install --verbose --no-build-isolation --editable . --config-settings editable-verbose=true

clean: clean-meson

clean-meson:
pip uninstall -y scikit-learn
# It seems in some cases removing the folder avoids weird compilation
# errors (e.g. when switching from numpy>=2 to numpy<2). For some
# errors (e.g. when switching from numpy>=2 to numpy<2). For some
# reason ninja clean -C $(DEFAULT_MESON_BUILD_DIR) is not
# enough
# enough.
rm -rf $(DEFAULT_MESON_BUILD_DIR)

dev-setuptools:
$(PYTHON) setup.py build_ext -i

clean-setuptools:
$(PYTHON) setup.py clean
rm -rf dist
14 changes: 7 additions & 7 deletions asv_benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

// Customizable commands for building, installing, and
// uninstalling the project. See asv.conf.json documentation.
//
// "install_command": ["python -mpip install {wheel_file}"],
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
// "build_command": ["python -m build --wheel -o {build_cache_dir} {build_dir}"],
"install_command": ["python -mpip install {wheel_file}"],
"uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
"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"],
Expand Down Expand Up @@ -72,12 +72,12 @@
// those due to dependency changes.
//
"matrix": {
"numpy": ["1.25.2"],
"scipy": ["1.11.2"],
"numpy": ["2.0.0"],
"scipy": ["1.14.0"],
"cython": ["3.0.10"],
"joblib": ["1.3.2"],
"threadpoolctl": ["3.2.0"],
"pandas": ["2.1.0"]
"pandas": ["2.2.2"]
},

// Combinations of libraries/python versions can be excluded/included
Expand Down
3 changes: 1 addition & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ jobs:
SKLEARN_ENABLE_DEBUG_CYTHON_DIRECTIVES: '1'
SKLEARN_RUN_FLOAT32_TESTS: '1'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '2' # non-default seed
BUILD_WITH_SETUPTOOLS: 'true'
# Linux environment to test the latest available dependencies.
# It runs tests requiring lightgbm, pandas and PyAMG.
pylatest_pip_openblas_pandas:
Expand Down Expand Up @@ -236,7 +235,7 @@ jobs:
)
matrix:
debian_atlas_32bit:
DOCKER_CONTAINER: 'i386/debian:11.2'
DOCKER_CONTAINER: 'i386/debian:12'
DISTRIB: 'debian-32'
COVERAGE: "true"
LOCK_FILE: './build_tools/azure/debian_atlas_32bit_lock.txt'
Expand Down
14 changes: 1 addition & 13 deletions build_tools/azure/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ scikit_learn_install() {
setup_ccache
show_installed_libraries

# Set parallelism to 3 to overlap IO bound tasks with CPU bound tasks on CI
# workers with 2 cores when building the compiled extensions of scikit-learn.
export SKLEARN_BUILD_PARALLEL=3

if [[ "$UNAMESTR" == "Darwin" && "$SKLEARN_TEST_NO_OPENMP" == "true" ]]; then
# Without openmp, we use the system clang. Here we use /usr/bin/ar
# instead because llvm-ar errors
Expand All @@ -129,9 +125,7 @@ scikit_learn_install() {
export LDFLAGS="$LDFLAGS -Wl,--sysroot=/"
fi

if [[ "$BUILD_WITH_SETUPTOOLS" == "true" ]]; then
python setup.py develop
elif [[ "$PIP_BUILD_ISOLATION" == "true" ]]; then
if [[ "$PIP_BUILD_ISOLATION" == "true" ]]; then
# Check that pip can automatically build scikit-learn with the build
# dependencies specified in pyproject.toml using an isolated build
# environment:
Expand All @@ -143,12 +137,6 @@ scikit_learn_install() {
# toolchain
ADDITIONAL_PIP_OPTIONS='-Csetup-args=--vsenv'
fi
# TODO Always add --check-build-dependencies when all CI builds have
# pip >= 22.1.1. At the time of writing, two CI builds (debian32_atlas and
# ubuntu_atlas) have an older pip
if pip install --help | grep check-build-dependencies; then
ADDITIONAL_PIP_OPTIONS="$ADDITIONAL_PIP_OPTIONS --check-build-dependencies"
fi
# Use the pre-installed build dependencies and build directly in the
# current environment.
pip install --verbose --no-build-isolation --editable . $ADDITIONAL_PIP_OPTIONS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
channels:
- defaults
dependencies:
- python=3.9
- python=3.11
- ccache
- pip
- pip:
Expand Down
Loading

0 comments on commit 2de80e1

Please sign in to comment.