Skip to content

Commit 45a8179

Browse files
glemaitreleouiedaNadimKawwaogriseladrinjalali
authored
Release 0.24.0 [cd build] (scikit-learn#19058)
Co-authored-by: Leonardo Uieda <leouieda@gmail.com> Co-authored-by: Nadim Kawwa <40652202+NadimKawwa@users.noreply.github.com> Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com> Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com> Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com> Co-authored-by: Juan Carlos Alfaro Jiménez <JuanCarlos.Alfaro@uclm.es> Co-authored-by: Matthew Calcote <matthew.calcote@connexta.com> Co-authored-by: novaya <51009628+novaya@users.noreply.github.com> Co-authored-by: David Katz <41651296+DavidKatz-il@users.noreply.github.com> Co-authored-by: Frans Larsson <frans.larsson@gmail.com> Co-authored-by: Maxime Prieur <maxime.prieur@insa-rouen.fr> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> Co-authored-by: Neal Fultz <nfultz@gmail.com> Co-authored-by: RamyaNP <56212418+RamyaNP@users.noreply.github.com> Co-authored-by: Thomas A Caswell <tcaswell@gmail.com> Co-authored-by: Amol Deshmukh <34318357+des137@users.noreply.github.com> Co-authored-by: Kot271828 <48412793+Kot271828@users.noreply.github.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> Co-authored-by: Nicolas Hug <contact@nicolas-hug.com> Co-authored-by: Rohan Paul <rohan-paul@users.noreply.github.com> Co-authored-by: Tim Gates <tim.gates@iress.com>
1 parent 2c1719e commit 45a8179

File tree

115 files changed

+1016
-814
lines changed

Some content is hidden

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

115 files changed

+1016
-814
lines changed

.github/workflows/wheels.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
check_build_trigger:
2323
name: Check build trigger
2424
runs-on: ubuntu-latest
25+
if: github.repository == 'scikit-learn/scikit-learn'
2526
outputs:
2627
build: ${{ steps.check_build_trigger.outputs.build }}
2728

@@ -86,7 +87,7 @@ jobs:
8687
SKLEARN_SKIP_NETWORK_TESTS=1
8788
SKLEARN_BUILD_PARALLEL=3
8889
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
89-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir} ${{ matrix.bitness }}
90+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir} ${{ matrix.bitness }}
9091
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.bitness }}
9192
CIBW_TEST_REQUIRES: pytest pandas threadpoolctl
9293
CIBW_TEST_COMMAND: bash {project}/build_tools/github/test_wheels.sh

.travis.yml

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,90 @@
1-
# make it explicit that we favor the new container-based travis workers
1+
# Make it explicit that we favor the
2+
# new container-based Travis workers
23
language: python
4+
dist: xenial
35

46
cache:
57
apt: true
68
directories:
7-
- $HOME/.cache/pip
8-
- $HOME/.ccache
9-
10-
dist: xenial
9+
- $HOME/.cache/pip
10+
- $HOME/.ccache
1111

1212
env:
1313
global:
14-
# Directory where tests are run from
15-
- TEST_DIR=/tmp/sklearn
14+
- CPU_COUNT=3
15+
- TEST_DIR=/tmp/sklearn # Test directory for continuous integration jobs
16+
- PYTEST_VERSION=latest
1617
- OMP_NUM_THREADS=2
1718
- OPENBLAS_NUM_THREADS=2
18-
- PYTEST_VERSION=latest
19+
- SKLEARN_BUILD_PARALLEL=3
20+
- SKLEARN_SKIP_NETWORK_TESTS=1
21+
# Custom environment variables for the ARM wheel builder
22+
- CIBW_BUILD_VERBOSITY=1
23+
- CIBW_TEST_REQUIRES="pytest pytest-xdist threadpoolctl"
24+
- CIBW_TEST_COMMAND="bash {project}/build_tools/travis/test_wheels.sh"
25+
- CIBW_ENVIRONMENT="CPU_COUNT=8
26+
OMP_NUM_THREADS=2
27+
OPENBLAS_NUM_THREADS=2
28+
SKLEARN_BUILD_PARALLEL=8
29+
SKLEARN_SKIP_NETWORK_TESTS=1"
1930

20-
matrix:
31+
jobs:
2132
include:
22-
# Linux environment to test scikit-learn against numpy and scipy master
23-
# installed from their CI wheels in a virtualenv with the Python
24-
# interpreter provided by travis.
2533
- python: 3.7
2634
env:
27-
- CHECK_WARNINGS="true"
28-
- CI_CPU_COUNT="3"
29-
if: type = cron OR commit_message =~ /\[scipy-dev\]/
35+
- CHECK_WARNING=true
36+
- BUILD_WITH_ICC=true
37+
if: type = cron OR commit_message =~ /\[icc-build\]/
3038

31-
# As above but build scikit-learn with Intel C compiler (ICC).
3239
- python: 3.7
40+
os: linux
41+
arch: arm64
42+
if: type = cron OR commit_message =~ /\[arm64\]/
3343
env:
34-
- CHECK_WARNING="true"
35-
- BUILD_WITH_ICC="true"
36-
- CI_CPU_COUNT="3"
37-
if: type = cron OR commit_message =~ /\[icc-build\]/
44+
- CPU_COUNT=8
45+
46+
# Linux environments to build the scikit-learn wheels
47+
# for the ARM64 arquitecture and Python 3.6 and newer
48+
- python: 3.6
49+
os: linux
50+
arch: arm64
51+
if: type = cron or commit_message =~ /\[cd build\]/
52+
env:
53+
- BUILD_WHEEL=true
54+
- CIBW_BUILD=cp36-manylinux_aarch64
3855

3956
- python: 3.7
57+
os: linux
58+
arch: arm64
59+
if: type = cron or commit_message =~ /\[cd build\]/
4060
env:
41-
- CI_CPU_COUNT="8"
61+
- BUILD_WHEEL=true
62+
- CIBW_BUILD=cp37-manylinux_aarch64
63+
64+
- python: 3.8
4265
os: linux
4366
arch: arm64
44-
if: type = cron OR commit_message =~ /\[arm64\]/
67+
if: type = cron or commit_message =~ /\[cd build\]/
68+
env:
69+
- BUILD_WHEEL=true
70+
- CIBW_BUILD=cp38-manylinux_aarch64
71+
72+
- python: 3.9
73+
os: linux
74+
arch: arm64
75+
if: type = cron or commit_message =~ /\[cd build\]/
76+
env:
77+
- BUILD_WHEEL=true
78+
- CIBW_BUILD=cp39-manylinux_aarch64
79+
80+
install: source build_tools/travis/install.sh || travis_terminate 1
81+
script: source build_tools/travis/script.sh || travis_terminate 1
82+
after_success: source build_tools/travis/after_success.sh || travis_terminate 1
4583

46-
install: source build_tools/travis/install.sh
47-
script:
48-
- bash build_tools/travis/test_script.sh || travis_terminate 1
49-
- bash build_tools/travis/test_docs.sh || travis_terminate 1
50-
- bash build_tools/travis/test_pytest_soft_dependency.sh || travis_terminate 1
51-
after_success: source build_tools/travis/after_success.sh
5284
notifications:
5385
webhooks:
5486
urls:
5587
- https://webhooks.gitter.im/e/4ffabb4df010b70cd624
56-
on_success: change # options: [always|never|change] default: always
57-
on_failure: always # options: [always|never|change] default: always
58-
on_start: never # options: [always|never|change] default: always
88+
on_success: change
89+
on_failure: always
90+
on_start: never

build_tools/circle/build_test_pypy.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,3 @@ export SKLEARN_BUILD_PARALLEL=3
3535
pip install --no-build-isolation -e .
3636

3737
python -m pytest sklearn
38-
python -m pytest doc/sphinxext/
39-
python -m pytest $(find doc -name '*.rst' | sort)

build_tools/travis/after_success.sh

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
#!/bin/bash
2-
# This script is meant to be called by the "after_success" step defined in
3-
# .travis.yml. See https://docs.travis-ci.com/ for more details.
42

5-
# License: 3-clause BSD
3+
# This script is meant to be called by the "after_success" step
4+
# defined in ".travis.yml". In particular, we upload the wheels
5+
# of the ARM64 architecture for the continuous deployment jobs.
66

77
set -e
88

9-
if [[ "$COVERAGE" == "true" ]]; then
10-
# Need to run codecov from a git checkout, so we copy .coverage
11-
# from TEST_DIR where pytest has been run
12-
cp $TEST_DIR/.coverage $TRAVIS_BUILD_DIR
9+
# The wheels cannot be uploaded on PRs
10+
if [[ $BUILD_WHEEL == true && $TRAVIS_EVENT_TYPE != pull_request ]]; then
11+
# Nightly upload token and staging upload token are set in
12+
# Travis settings (originally generated at Anaconda cloud)
13+
if [[ $TRAVIS_EVENT_TYPE == cron ]]; then
14+
ANACONDA_ORG="scipy-wheels-nightly"
15+
ANACONDA_TOKEN="$SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN"
16+
else
17+
ANACONDA_ORG="scikit-learn-wheels-staging"
18+
ANACONDA_TOKEN="$SCIKIT_LEARN_STAGING_UPLOAD_TOKEN"
19+
fi
1320

14-
# Ignore codecov failures as the codecov server is not
15-
# very reliable but we don't want travis to report a failure
16-
# in the github UI just because the coverage report failed to
17-
# be published.
18-
codecov --root $TRAVIS_BUILD_DIR || echo "codecov upload failed"
21+
pip install git+https://github.com/Anaconda-Server/anaconda-client
22+
23+
# Force a replacement if the remote file already exists
24+
anaconda -t $ANACONDA_TOKEN upload --force -u $ANACONDA_ORG wheelhouse/*.whl
25+
echo "Index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
1926
fi

build_tools/travis/install.sh

100755100644
Lines changed: 6 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,13 @@
11
#!/bin/bash
2-
# This script is meant to be called by the "install" step defined in
3-
# .travis.yml. See https://docs.travis-ci.com/ for more details.
4-
# The behavior of the script is controlled by environment variabled defined
5-
# in the .travis.yml in the top level folder of the project.
62

7-
# License: 3-clause BSD
8-
9-
# Travis clone scikit-learn/scikit-learn repository in to a local repository.
10-
# We use a cached directory with three scikit-learn repositories (one for each
11-
# matrix entry) from which we pull from local Travis repository. This allows
12-
# us to keep build artefact for gcc + cython, and gain time
3+
# This script is meant to be called by the "install" step
4+
# defined in the ".travis.yml" file. In particular, it is
5+
# important that we call to the right installation script.
136

147
set -e
158

16-
# Fail fast
17-
echo "CPU Arch: ${TRAVIS_CPU_ARCH}"
18-
19-
# jq is used in travis_fastfail.sh, it's already pre-installed in non arm64
20-
# environments
21-
sudo apt-get install jq
22-
23-
build_tools/travis/travis_fastfail.sh
24-
25-
# Imports get_dep
26-
source build_tools/shared.sh
27-
28-
echo "List files from cached directories"
29-
echo "pip:"
30-
ls $HOME/.cache/pip
31-
32-
export CC=/usr/lib/ccache/gcc
33-
export CXX=/usr/lib/ccache/g++
34-
# Useful for debugging how ccache is used
35-
# export CCACHE_LOGFILE=/tmp/ccache.log
36-
# ~60M is used by .ccache when compiling from scratch at the time of writing
37-
ccache --max-size 100M --show-stats
38-
39-
# Deactivate the travis-provided virtual environment and setup a
40-
# conda-based environment instead
41-
# If Travvis has language=generic, deactivate does not exist. `|| :` will pass.
42-
deactivate || :
43-
44-
45-
# Install miniconda
46-
if [[ "$TRAVIS_CPU_ARCH" == "arm64" ]]; then
47-
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh -O miniconda.sh
9+
if [[ $BUILD_WHEEL == true ]]; then
10+
source build_tools/travis/install_wheels.sh
4811
else
49-
fname=Miniconda3-latest-Linux-x86_64.sh
50-
wget https://repo.continuum.io/miniconda/$fname -O miniconda.sh
12+
source build_tools/travis/install_master.sh
5113
fi
52-
MINICONDA_PATH=$HOME/miniconda
53-
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
54-
export PATH=$MINICONDA_PATH/bin:$PATH
55-
conda update --yes conda
56-
57-
# Create environment and install dependencies
58-
conda create -n testenv --yes python=3.7
59-
60-
source activate testenv
61-
62-
if [[ "$TRAVIS_CPU_ARCH" == "amd64" ]]; then
63-
pip install --upgrade pip setuptools
64-
echo "Installing numpy and scipy master wheels"
65-
dev_anaconda_url=https://pypi.anaconda.org/scipy-wheels-nightly/simple
66-
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url numpy scipy pandas
67-
pip install --pre cython
68-
echo "Installing joblib master"
69-
pip install https://github.com/joblib/joblib/archive/master.zip
70-
echo "Installing pillow master"
71-
pip install https://github.com/python-pillow/Pillow/archive/master.zip
72-
else
73-
conda install -y scipy numpy pandas cython
74-
pip install joblib threadpoolctl
75-
fi
76-
77-
pip install $(get_dep pytest $PYTEST_VERSION) pytest-cov pytest-xdist
78-
79-
# Build scikit-learn in the install.sh script to collapse the verbose
80-
# build output in the travis output when it succeeds.
81-
python --version
82-
python -c "import numpy; print('numpy %s' % numpy.__version__)"
83-
python -c "import scipy; print('scipy %s' % scipy.__version__)"
84-
85-
if [[ "$BUILD_WITH_ICC" == "true" ]]; then
86-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
87-
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
88-
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
89-
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
90-
sudo apt-get update
91-
sudo apt-get install intel-oneapi-icc
92-
source /opt/intel/oneapi/setvars.sh
93-
94-
# The build_clib command is implicitly used to build libsvm-skl. To compile
95-
# with a different compiler we also need to specify the compiler for this
96-
# command.
97-
python setup.py build_ext --compiler=intelem -i -j "${CI_CPU_COUNT}" build_clib --compiler=intelem
98-
else
99-
# Use setup.py instead of `pip install -e .` to be able to pass the -j flag
100-
# to speed-up the building multicore CI machines.
101-
python setup.py build_ext --inplace -j "${CI_CPU_COUNT}"
102-
fi
103-
104-
python setup.py develop
105-
106-
ccache --show-stats
107-
# Useful for debugging how ccache is used
108-
# cat $CCACHE_LOGFILE
109-
110-
# fast fail
111-
build_tools/travis/travis_fastfail.sh

0 commit comments

Comments
 (0)