Skip to content

Commit

Permalink
Merge branch 'scikit-learn:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
virchan authored Feb 9, 2024
2 parents c2fdfc0 + 7f1d4d0 commit b46f103
Show file tree
Hide file tree
Showing 108 changed files with 1,902 additions and 838 deletions.
11 changes: 7 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ jobs:
- OPENBLAS_NUM_THREADS: 2
- CONDA_ENV_NAME: testenv
- LOCK_FILE: build_tools/circle/doc_min_dependencies_linux-64_conda.lock
# Do not fail if the documentation build generates warnings
- SKLEARN_DOC_BUILD_WARNINGS_AS_ERRORS: 'false'
# Do not fail if the documentation build generates warnings with minimum
# dependencies as long as we can avoid raising warnings with more recent
# versions of the same dependencies.
- SKLEARN_WARNINGS_AS_ERRORS: '0'
steps:
- checkout
- run: ./build_tools/circle/checkout_merge_commit.sh
Expand Down Expand Up @@ -60,8 +62,9 @@ jobs:
- OPENBLAS_NUM_THREADS: 2
- CONDA_ENV_NAME: testenv
- LOCK_FILE: build_tools/circle/doc_linux-64_conda.lock
# Make sure that we fail if the documentation build generates warnings
- SKLEARN_DOC_BUILD_WARNINGS_AS_ERRORS: 'true'
# Make sure that we fail if the documentation build generates warnings with
# recent versions of the dependencies.
- SKLEARN_WARNINGS_AS_ERRORS: '1'
steps:
- checkout
- run: ./build_tools/circle/checkout_merge_commit.sh
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "CodeQL"

on:
push:
branches: [ "main", "*.X" ]
pull_request:
branches: [ "main", "*.X" ]
schedule:
- cron: '0 6 * * 1'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript', 'python' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
49 changes: 37 additions & 12 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,18 @@ jobs:
platform_id: macosx_x86_64

# MacOS arm64
# The wheel for the latest Python version is built and tested on
# Cirrus CI but due to limited build time for free accounts on Cirrus
# CI, we build the macOS arm64 wheels for the other Python versions on
# Github Actions via cross-compilation (without running the tests).
- os: macos-latest
- os: macos-14
python: 39
platform_id: macosx_arm64
- os: macos-latest
- os: macos-14
python: 310
platform_id: macosx_arm64
- os: macos-latest
- os: macos-14
python: 311
platform_id: macosx_arm64
- os: macos-14
python: 312
platform_id: macosx_arm64

steps:
- name: Checkout scikit-learn
Expand All @@ -125,25 +124,51 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9' # update once build dependencies are available
python-version: "3.11" # update once build dependencies are available

- name: Install conda for macos arm64
if: ${{ matrix.platform_id == 'macosx_arm64' }}
run: |
set -ex
# macos arm64 runners do not have conda installed. Thus we much install conda manually
EXPECTED_SHA="dd832d8a65a861b5592b2cf1d55f26031f7c1491b30321754443931e7b1e6832"
MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh"
curl -L --retry 10 $MINIFORGE_URL -o miniforge.sh
# Check SHA
file_sha=$(shasum -a 256 miniforge.sh | awk '{print $1}')
if [ "$EXPECTED_SHA" != "$file_sha" ]; then
echo "SHA values did not match!"
exit 1
fi
# Install miniforge
MINIFORGE_PATH=$HOME/miniforge
bash ./miniforge.sh -b -p $MINIFORGE_PATH
echo "$MINIFORGE_PATH/bin" >> $GITHUB_PATH
echo "CONDA_HOME=$MINIFORGE_PATH" >> $GITHUB_ENV
- name: Set conda environment for non-macos arm64 environments
if: ${{ matrix.platform_id != 'macosx_arm64' }}
run: |
# Non-macos arm64 envrionments already have conda installed
echo "CONDA_HOME=/usr/local/miniconda" >> $GITHUB_ENV
- name: Build and test wheels
env:
CIBW_PRERELEASE_PYTHONS: ${{ matrix.prerelease }}
CIBW_ENVIRONMENT: SKLEARN_SKIP_NETWORK_TESTS=1
SKLEARN_BUILD_PARALLEL=3
SKLEARN_BUILD_PARALLEL=3
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_ARCHS: all
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir}
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }}
CIBW_TEST_REQUIRES: pytest pandas threadpoolctl
CIBW_TEST_COMMAND: bash {project}/build_tools/wheels/test_wheels.sh
CIBW_TEST_COMMAND_WINDOWS: bash {project}/build_tools/github/test_windows_wheels.sh ${{ matrix.python }}
CIBW_BUILD_VERBOSITY: 1
CONDA_HOME: /usr/local/miniconda

run: bash build_tools/wheels/build_wheels.sh

Expand Down Expand Up @@ -175,7 +200,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9' # update once build dependencies are available
python-version: "3.9" # update once build dependencies are available

- name: Build source distribution
run: bash build_tools/github/build_source.sh
Expand Down
2 changes: 1 addition & 1 deletion asv_benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"matrix": {
"numpy": ["1.25.2"],
"scipy": ["1.11.2"],
"cython": ["3.0.3"],
"cython": ["3.0.8"],
"joblib": ["1.3.2"],
"threadpoolctl": ["3.2.0"],
"pandas": ["2.1.0"]
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
pylatest_pip_scipy_dev:
DISTRIB: 'conda-pip-scipy-dev'
LOCK_FILE: './build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock'
CHECK_WARNINGS: 'true'
SKLEARN_WARNINGS_AS_ERRORS: '1'
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
# Tests that require large downloads over the networks are skipped in CI.
# Here we make sure, that they are still run on a regular basis.
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
pymin_conda_forge_openblas_ubuntu_2204:
DISTRIB: 'conda'
LOCK_FILE: './build_tools/azure/pymin_conda_forge_openblas_ubuntu_2204_linux-64_conda.lock'
CHECK_WARNINGS: 'true'
SKLEARN_WARNINGS_AS_ERRORS: '1'
COVERAGE: 'false'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '0' # non-default seed

Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
DISTRIB: 'conda-pip-latest'
LOCK_FILE: './build_tools/azure/pylatest_pip_openblas_pandas_linux-64_conda.lock'
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
CHECK_WARNINGS: 'true'
SKLEARN_WARNINGS_AS_ERRORS: '1'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '3' # non-default seed
# disable pytest-xdist to have 1 job where OpenMP and BLAS are not single
# threaded because by default the tests configuration (sklearn/conftest.py)
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
pymin_conda_forge_mkl:
DISTRIB: 'conda'
LOCK_FILE: ./build_tools/azure/pymin_conda_forge_mkl_win-64_conda.lock
CHECK_WARNINGS: 'true'
SKLEARN_WARNINGS_AS_ERRORS: '1'
# The Azure Windows runner is typically much slower than other CI
# runners due to the lack of compiler cache. Running the tests with
# coverage enabled make them run extra slower. Since very few parts of
Expand Down
6 changes: 3 additions & 3 deletions build_tools/azure/debian_atlas_32bit_lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
#
attrs==23.2.0
# via pytest
coverage==7.4.0
coverage==7.4.1
# via pytest-cov
cython==0.29.33
cython==3.0.8
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
iniconfig==2.0.0
# via pytest
joblib==1.2.0
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
packaging==23.2
# via pytest
pluggy==1.3.0
pluggy==1.4.0
# via pytest
py==1.11.0
# via pytest
Expand Down
2 changes: 1 addition & 1 deletion build_tools/azure/debian_atlas_32bit_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DO NOT EDIT: this file is generated from the specification found in the
# following script to centralize the configuration for CI builds:
# build_tools/update_environments_and_lock_files.py
cython==0.29.33 # min
cython==3.0.8 # min
joblib==1.2.0 # min
threadpoolctl==2.2.0
pytest==7.1.2 # min
Expand Down
Loading

0 comments on commit b46f103

Please sign in to comment.