Skip to content

CI: move Linux and MacOS Azure builds to conda lock files #22448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
36279ff
First attempt at using lock files in the CI
lesteve Feb 9, 2022
dafedd6
fix
lesteve Feb 11, 2022
cc3d965
debug
lesteve Feb 11, 2022
1a08f1a
it
lesteve Feb 11, 2022
6a74cb1
fix
lesteve Feb 11, 2022
c2ae825
fix
lesteve Feb 11, 2022
a23dc48
fix
lesteve Feb 11, 2022
6a47b49
Need openmp in OSX build
lesteve Feb 11, 2022
e53f6fa
Merge branch 'main' into ci-lock-file
lesteve Feb 16, 2022
d2a6dea
Use lock file in py37_conda_defaults_openblas build.
lesteve Feb 16, 2022
86638b8
add missing lock and env file
lesteve Feb 16, 2022
e890a4b
fix lock filename
lesteve Feb 16, 2022
854c735
Switch to conda-lock dev version + regenerate lock files
lesteve Feb 18, 2022
08fc05a
Fix lock filenames
lesteve Feb 18, 2022
4a41fdf
Using conda-lock.yml at the end of the file seems to make conda-lock …
lesteve Feb 19, 2022
9b793d5
debug with tmate
lesteve Feb 21, 2022
c987848
Try conda update
lesteve Feb 21, 2022
d0e9115
Fix macOS
lesteve Feb 21, 2022
ab2337e
debug
lesteve Feb 21, 2022
09fb44d
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Feb 22, 2022
2531ea6
Re-add logic for LOCK_FILE
lesteve Feb 22, 2022
aacd4a3
iter
lesteve Feb 22, 2022
988c71b
Try to use pip-compile for ubuntu_atlas
lesteve Feb 23, 2022
efbc928
fix
lesteve Feb 23, 2022
34153a7
fix
lesteve Feb 23, 2022
4004552
no coverage
lesteve Feb 23, 2022
7365339
Use correct joblib oldest supported version
lesteve Feb 23, 2022
4b8e8e7
Add generation of ubuntu_atlas to generate script
lesteve Feb 23, 2022
2864b25
Use latest conda-lock version which includes fixes for matplotlib pip…
lesteve Mar 7, 2022
d73707a
Use lock file for latest versions with pip
lesteve Mar 7, 2022
4890bb6
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Mar 7, 2022
f19b87b
Move to python 3.8 and more recent min dependencies
lesteve Mar 7, 2022
71653a1
Update script + regenerate lock files
lesteve Mar 7, 2022
9643017
Use lock file for pylatest_pip_openblas_pandas build
lesteve Mar 7, 2022
71a669b
fix
lesteve Mar 7, 2022
f0f6027
use mamba that seems to have a consistent order for lock files if we …
lesteve Mar 7, 2022
88e18c1
Use python from defaults to mirror what is done in main
lesteve Mar 8, 2022
7daef3a
Move py38_conda_forge_openblas_ubuntu_1804 to lock file
lesteve Mar 8, 2022
2026d4c
Add lock file for pylatest_conda_mkl_no_openmp build
lesteve Mar 8, 2022
8f8b160
Add windows py38_conda_forge_mkl build
lesteve Mar 9, 2022
60c1d5f
fix
lesteve Mar 9, 2022
4625ce6
fix
lesteve Mar 9, 2022
2466b9c
debug
lesteve Mar 9, 2022
96af7b1
debug
lesteve Mar 9, 2022
0f2eb46
revert windows stuff
lesteve Mar 9, 2022
85f2204
Use conda-lock release
lesteve Mar 9, 2022
fa99f80
cosmetics
lesteve Mar 9, 2022
76bac7d
update script to work from root folder
lesteve Mar 9, 2022
688524b
Move debian-32 buid to lock file
lesteve Mar 10, 2022
394a9b8
debug
lesteve Mar 10, 2022
e88d718
debug
lesteve Mar 10, 2022
4e8313e
debug
lesteve Mar 10, 2022
d706ab3
pass env var to docker
lesteve Mar 10, 2022
62a4563
Need PYTEST_XDIST_VERSION at test-time ...
lesteve Mar 10, 2022
2baa2e7
Remove dead code
lesteve Mar 10, 2022
b72ea80
[icc-build] move icc build to lock file + tweaks
lesteve Mar 10, 2022
977da49
[icc-build] [pypy] fixes
lesteve Mar 10, 2022
89f9c26
[icc-build] [pypy] fixes
lesteve Mar 10, 2022
47858f9
[icc-build] [pypy] fixes
lesteve Mar 10, 2022
f737891
[pypy] use normal python in base environment
lesteve Mar 10, 2022
620fd91
[icc-build] [pypy] Remove more dead code
lesteve Mar 11, 2022
7dd24c0
[scipy-dev] Hacky way to support scipy-dev build to work-around conda…
lesteve Mar 11, 2022
e3452fb
not using mamba anymore
lesteve Mar 11, 2022
9f9fec0
[scipy-dev] trigger nightly build
lesteve Mar 11, 2022
a14ba48
[scipy-dev] fix lockfile
lesteve Mar 11, 2022
87a0824
[scipy-dev] use defaults channel to mirror main
lesteve Mar 11, 2022
b535d24
[scipy-dev] trigger nightly build
lesteve Mar 11, 2022
1bc7a6d
[scipy-dev] debug
lesteve Mar 11, 2022
a3b9269
[scipy-dev] pin pytest
lesteve Mar 12, 2022
10fb4cb
remove debug
lesteve Mar 12, 2022
b0f144f
Remove unused variables
lesteve Mar 12, 2022
54bbb28
Merge branch 'main' into ci-lock-file
lesteve Mar 14, 2022
566657c
remove unneeded line
lesteve Mar 14, 2022
d86843c
Add environment + script to generate them
lesteve Mar 16, 2022
a81a793
Regenerate lock files from environment/requirements file
lesteve Mar 16, 2022
324f8fd
rename script to generate environment file
lesteve Mar 16, 2022
55f7533
pin conda-lock
lesteve Mar 17, 2022
94bfc22
Move environment + lock file updates into a single script.
lesteve Mar 17, 2022
0269fc6
[scipy-dev] [pypy] [icc-build] Trigger CI
lesteve Mar 17, 2022
ceedbb3
Add docstring to script + other tweaks
lesteve Mar 18, 2022
cea7597
cosmit
lesteve Mar 18, 2022
06e749e
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Mar 29, 2022
abec451
Apply suggestions from code review
lesteve Mar 30, 2022
d5217fd
Update script + regenerate lock files
lesteve Mar 30, 2022
b9be31e
Switch to explicit lock files
lesteve Apr 5, 2022
d3d6087
Fix
lesteve Apr 5, 2022
08fe15a
Fix lockfile names
lesteve Apr 5, 2022
4cc177e
Needs conda-lock for conda+pip envs
lesteve Apr 5, 2022
9fcd718
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Apr 19, 2022
d5c44fe
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Apr 20, 2022
f720d49
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Apr 20, 2022
b1f0050
Update build_tools/azure/update_environments_and_lock_files.py
lesteve Apr 21, 2022
1afb586
Install alpha Cython version from PyPI
lesteve Apr 21, 2022
4d894e2
[scipy-dev] Remove numpy et al from environment.yml in scipy-dev build.
lesteve Apr 22, 2022
4f641b4
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Apr 22, 2022
2fd8850
[scipy-dev] [pypy] [icc-build] Trigger CI
lesteve Apr 22, 2022
ff4f403
Add comments about script dependencies
lesteve Apr 25, 2022
40b1953
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Apr 25, 2022
17c036c
Trigger CI
lesteve Apr 25, 2022
33e1b4a
[scipy-dev] [pypy] [icc-build] Trigger CI
lesteve Apr 25, 2022
e24be39
Add text about default_package_constraints
lesteve Apr 28, 2022
a8b2a7e
Make script run on osx-arm64 machines
lesteve Apr 29, 2022
f96b00e
Update environment and lock files
lesteve Apr 29, 2022
6fc77e5
[scipy-dev] [pypy] [icc-build] Trigger CI
lesteve Apr 29, 2022
e56334a
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve May 9, 2022
8cf6d64
[scipy-dev] [pypy] [icc-build] [nogil] Trigger CI
lesteve May 9, 2022
c5e8be9
Update lock files
lesteve May 9, 2022
4edb574
wip
lesteve May 9, 2022
054a0d3
[scipy-dev] [pypy] [icc-build] [nogil] Add lock files for python-nogil
lesteve May 9, 2022
7c4f4a1
[scipy-dev] [pypy] [icc-build] [nogil] Fix
lesteve May 10, 2022
fb1d21f
Remove nogil build from script
lesteve May 11, 2022
d8c11e4
Use --upgrade to for pip-compile to update dependencies
lesteve May 11, 2022
b81fea9
Rerun script
lesteve May 11, 2022
2f4ebdc
Move comment to requirement file + add --upgrade
lesteve May 12, 2022
66f0f07
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve May 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 15 additions & 33 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
matrix:
pylatest_pip_scipy_dev:
DISTRIB: 'conda-pip-scipy-dev'
PYTHON_VERSION: '*'
LOCK_FILE: './build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock'
CHECK_WARNINGS: 'true'
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
TEST_DOCSTRINGS: 'true'
Expand Down Expand Up @@ -103,6 +103,7 @@ jobs:
matrix:
pylatest_pip_nogil:
DISTRIB: 'pip-nogil'
LOCK_FILE: './build_tools/azure/python_nogil_lock.txt'
COVERAGE: 'false'

# Check compilation with intel C++ compiler (ICC)
Expand All @@ -122,9 +123,7 @@ jobs:
matrix:
pylatest_conda_forge_mkl:
DISTRIB: 'conda'
CONDA_CHANNEL: 'conda-forge'
PYTHON_VERSION: '*'
BLAS: 'mkl'
LOCK_FILE: 'build_tools/azure/pylatest_conda_forge_mkl_no_coverage_linux-64_conda.lock'
COVERAGE: 'false'
BUILD_WITH_ICC: 'true'

Expand All @@ -144,10 +143,9 @@ jobs:
)
matrix:
pypy3:
DISTRIB: 'conda-mamba-pypy3'
DOCKER_CONTAINER: 'condaforge/mambaforge-pypy3:4.10.3-5'
PILLOW_VERSION: 'none'
PANDAS_VERSION: 'none'
DOCKER_CONTAINER: 'condaforge/miniforge3:4.10.3-5'
DISTRIB: 'conda-pypy3'
LOCK_FILE: './build_tools/azure/pypy3_linux-64_conda.lock'

# Will run all the time regardless of linting outcome.
- template: build_tools/azure/posix.yml
Expand All @@ -163,9 +161,7 @@ jobs:
matrix:
pylatest_conda_forge_mkl:
DISTRIB: 'conda'
CONDA_CHANNEL: 'conda-forge'
PYTHON_VERSION: '*'
BLAS: 'mkl'
LOCK_FILE: './build_tools/azure/pylatest_conda_forge_mkl_linux-64_conda.lock'
COVERAGE: 'true'
SHOW_SHORT_SUMMARY: 'true'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '42' # default global random seed
Expand All @@ -184,9 +180,7 @@ jobs:
matrix:
py38_conda_forge_openblas_ubuntu_1804:
DISTRIB: 'conda'
CONDA_CHANNEL: 'conda-forge'
PYTHON_VERSION: '3.8'
BLAS: 'openblas'
LOCK_FILE: './build_tools/azure/py38_conda_forge_openblas_ubuntu_1804_linux-64_conda.lock'
COVERAGE: 'false'
BUILD_WITH_ICC: 'false'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '0' # non-default seed
Expand All @@ -207,30 +201,21 @@ jobs:
# i.e. numpy 1.17.4 and scipy 1.3.3
ubuntu_atlas:
DISTRIB: 'ubuntu'
JOBLIB_VERSION: 'min'
PANDAS_VERSION: 'none'
THREADPOOLCTL_VERSION: 'min'
LOCK_FILE: './build_tools/azure/ubuntu_atlas_lock.txt'
COVERAGE: 'false'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '1' # non-default seed
# Linux + Python 3.8 build with OpenBLAS
py38_conda_defaults_openblas:
DISTRIB: 'conda'
CONDA_CHANNEL: 'defaults' # Anaconda main channel
PYTHON_VERSION: '3.8'
BLAS: 'openblas'
NUMPY_VERSION: 'min'
SCIPY_VERSION: 'min'
MATPLOTLIB_VERSION: 'min'
THREADPOOLCTL_VERSION: '2.2.0'
LOCK_FILE: './build_tools/azure/py38_conda_defaults_openblas_linux-64_conda.lock'
SKLEARN_ENABLE_DEBUG_CYTHON_DIRECTIVES: '1'
SKLEARN_RUN_FLOAT32_TESTS: '1'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '2' # non-default seed
# Linux environment to test the latest available dependencies.
# It runs tests requiring lightgbm, pandas and PyAMG.
pylatest_pip_openblas_pandas:
DISTRIB: 'conda-pip-latest'
PYTHON_VERSION: '3.9'
PYTEST_VERSION: '6.2.5'
LOCK_FILE: './build_tools/azure/pylatest_pip_openblas_pandas_linux-64_conda.lock'
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
TEST_DOCSTRINGS: 'true'
CHECK_WARNINGS: 'true'
Expand All @@ -248,13 +233,11 @@ jobs:
)
matrix:
debian_atlas_32bit:
DISTRIB: 'debian-32'
DOCKER_CONTAINER: 'i386/debian:11.2'
JOBLIB_VERSION: 'min'
DISTRIB: 'debian-32'
LOCK_FILE: './build_tools/azure/debian_atlas_32bit_lock.txt'
# disable pytest xdist due to unknown bug with 32-bit container
PYTEST_XDIST_VERSION: 'none'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove PYTEST_XDIST_VERSION as well? I do not think it is being used anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PYTEST_XDIST_VERSION is still used in the test script:

if [[ "$PYTEST_XDIST_VERSION" != "none" ]]; then
TEST_CMD="$TEST_CMD -n$CPU_COUNT"

Longer term, I was thinking about cleaning up environment variables like PYTEST_XDIST_VERSION and COVERAGE and check whether a package is installed instead of relying on a environment variable.

PYTEST_VERSION: 'min'
THREADPOOLCTL_VERSION: '2.2.0'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '4' # non-default seed

- template: build_tools/azure/posix.yml
Expand All @@ -270,12 +253,11 @@ jobs:
matrix:
pylatest_conda_forge_mkl:
DISTRIB: 'conda'
BLAS: 'mkl'
CONDA_CHANNEL: 'conda-forge'
LOCK_FILE: './build_tools/azure/pylatest_conda_forge_mkl_osx-64_conda.lock'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '5' # non-default seed
pylatest_conda_mkl_no_openmp:
DISTRIB: 'conda'
BLAS: 'mkl'
LOCK_FILE: './build_tools/azure/pylatest_conda_mkl_no_openmp_osx-64_conda.lock'
SKLEARN_TEST_NO_OPENMP: 'true'
SKLEARN_SKIP_OPENMP_TEST: 'true'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '6' # non-default seed
Expand Down
34 changes: 34 additions & 0 deletions build_tools/azure/debian_atlas_32bit_lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --output-file=build_tools/azure/debian_atlas_32bit_lock.txt build_tools/azure/debian_atlas_32bit_requirements.txt
#
atomicwrites==1.4.0
# via pytest
attrs==21.4.0
# via pytest
cython==0.29.28
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
importlib-metadata==4.11.3
# via pytest
joblib==1.0.0
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
more-itertools==8.13.0
# via pytest
packaging==21.3
# via pytest
pluggy==0.13.1
# via pytest
py==1.11.0
# via pytest
pyparsing==3.0.9
# via packaging
pytest==5.0.1
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
threadpoolctl==2.2.0
# via -r build_tools/azure/debian_atlas_32bit_requirements.txt
wcwidth==0.2.5
# via pytest
zipp==3.8.0
# via importlib-metadata
7 changes: 7 additions & 0 deletions build_tools/azure/debian_atlas_32bit_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DO NOT EDIT: this file is generated from the specification found in the
# following script to centralize the configuration for all Azure CI builds:
# build_tools/azure/update_environments_and_lock_files.py
cython
joblib==1.0.0 # min
threadpoolctl==2.2.0
pytest==5.0.1 # min
131 changes: 29 additions & 102 deletions build_tools/azure/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,8 @@ set -x
source build_tools/shared.sh

UNAMESTR=`uname`

CCACHE_LINKS_DIR="/tmp/ccache"


make_conda() {
TO_INSTALL="$@"
if [[ "$DISTRIB" == *"mamba"* ]]; then
mamba create -n $VIRTUALENV --yes $TO_INSTALL
else
conda config --show
conda create -n $VIRTUALENV --yes $TO_INSTALL
fi
source activate $VIRTUALENV
}

setup_ccache() {
CCACHE_BIN=`which ccache || echo ""`
if [[ "${CCACHE_BIN}" == "" ]]; then
Expand Down Expand Up @@ -53,8 +40,8 @@ pre_python_environment_install() {
python3-matplotlib libatlas3-base libatlas-base-dev \
python3-virtualenv python3-pandas ccache

elif [[ "$DISTRIB" == "conda-mamba-pypy3" ]]; then
# condaforge/mambaforge-pypy3 needs compilers
elif [[ "$DISTRIB" == "conda-pypy3" ]]; then
# need compilers
apt-get -yq update
apt-get -yq install build-essential

Expand All @@ -63,6 +50,14 @@ pre_python_environment_install() {
sudo apt-get -yq update
sudo apt-get install -yq ccache
sudo apt-get build-dep -yq python3 python3-dev
setup_ccache # speed-up the build of CPython itself
# build Python nogil
PYTHON_NOGIL_CLONE_PATH=../nogil
git clone --depth 1 https://github.com/colesbury/nogil $PYTHON_NOGIL_CLONE_PATH
cd $PYTHON_NOGIL_CLONE_PATH
./configure && make -j 2
export PYTHON_NOGIL_PATH="${PYTHON_NOGIL_CLONE_PATH}/python"
cd $OLDPWD

elif [[ "$BUILD_WITH_ICC" == "true" ]]; then
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Expand All @@ -76,103 +71,35 @@ pre_python_environment_install() {
fi
}

python_environment_install() {
if [[ "$DISTRIB" == "conda" || "$DISTRIB" == *"mamba"* ]]; then

if [[ "$CONDA_CHANNEL" != "" ]]; then
TO_INSTALL="--override-channels -c $CONDA_CHANNEL"
else
TO_INSTALL=""
fi
python_environment_install_and_activate() {
if [[ "$DISTRIB" == "conda"* ]]; then
conda update -n base conda -y
# pin conda-lock to latest released version (needs manual update from time to time)
conda install -c conda-forge conda-lock==1.0.5 -y
conda-lock install --name $VIRTUALENV $LOCK_FILE
source activate $VIRTUALENV

if [[ "$DISTRIB" == *"pypy"* ]]; then
TO_INSTALL="$TO_INSTALL pypy"
else
TO_INSTALL="$TO_INSTALL python=$PYTHON_VERSION"
fi

TO_INSTALL="$TO_INSTALL ccache pip blas[build=$BLAS]"

TO_INSTALL="$TO_INSTALL $(get_dep numpy $NUMPY_VERSION)"
TO_INSTALL="$TO_INSTALL $(get_dep scipy $SCIPY_VERSION)"
TO_INSTALL="$TO_INSTALL $(get_dep cython $CYTHON_VERSION)"
TO_INSTALL="$TO_INSTALL $(get_dep joblib $JOBLIB_VERSION)"
TO_INSTALL="$TO_INSTALL $(get_dep pandas $PANDAS_VERSION)"
TO_INSTALL="$TO_INSTALL $(get_dep pyamg $PYAMG_VERSION)"
TO_INSTALL="$TO_INSTALL $(get_dep Pillow $PILLOW_VERSION)"
TO_INSTALL="$TO_INSTALL $(get_dep matplotlib $MATPLOTLIB_VERSION)"

if [[ "$UNAMESTR" == "Darwin" ]] && [[ "$SKLEARN_TEST_NO_OPENMP" != "true" ]]; then
TO_INSTALL="$TO_INSTALL compilers llvm-openmp"
fi

make_conda $TO_INSTALL

elif [[ "$DISTRIB" == "ubuntu" ]] || [[ "$DISTRIB" == "debian-32" ]]; then
elif [[ "$DISTRIB" == "ubuntu" || "$DISTRIB" == "debian-32" ]]; then
python3 -m virtualenv --system-site-packages --python=python3 $VIRTUALENV
source $VIRTUALENV/bin/activate
pip install -r "${LOCK_FILE}"

python -m pip install $(get_dep cython $CYTHON_VERSION) \
$(get_dep joblib $JOBLIB_VERSION)

elif [[ "$DISTRIB" == "conda-pip-latest" ]]; then
# Since conda main channel usually lacks behind on the latest releases,
# we use pypi to test against the latest releases of the dependencies.
# conda is still used as a convenient way to install Python and pip.
make_conda "ccache python=$PYTHON_VERSION"
python -m pip install -U pip

python -m pip install pandas matplotlib scikit-image pyamg
# do not install dependencies for lightgbm since it requires scikit-learn.
python -m pip install "lightgbm>=3.0.0" --no-deps
elif [[ "$DISTRIB" == "pip-nogil" ]]; then
${PYTHON_NOGIL_PATH} -m venv $VIRTUALENV
source $VIRTUALENV/bin/activate
pip install -r "${LOCK_FILE}"
fi

elif [[ "$DISTRIB" == "conda-pip-scipy-dev" ]]; then
make_conda "ccache python=$PYTHON_VERSION"
python -m pip install -U pip
echo "Installing numpy and scipy master wheels"
if [[ "$DISTRIB" == "conda-pip-scipy-dev" ]]; then
echo "Installing development dependency wheels"
dev_anaconda_url=https://pypi.anaconda.org/scipy-wheels-nightly/simple
pip install --pre --upgrade --timeout=60 --extra-index $dev_anaconda_url numpy pandas scipy
echo "Installing Cython from PyPI enabling pre-releases"
pip install --pre cython
echo "Installing joblib master"
pip install https://github.com/joblib/joblib/archive/master.zip
echo "Installing pillow master"
pip install https://github.com/python-pillow/Pillow/archive/main.zip

elif [[ "$DISTRIB" == "pip-nogil" ]]; then
setup_ccache # speed-up the build of CPython it-self
ORIGINAL_FOLDER=`pwd`
cd ..
git clone --depth 1 https://github.com/colesbury/nogil
cd nogil
./configure && make -j 2
./python -m venv $ORIGINAL_FOLDER/$VIRTUALENV
cd $ORIGINAL_FOLDER
source $VIRTUALENV/bin/activate

python -m pip install -U pip
# The pip version that comes with the nogil branch of CPython
# automatically uses the custom nogil index as its highest priority
# index to fetch patched versions of libraries with native code that
# would otherwise depend on the GIL.
echo "Installing build dependencies with pip from the nogil repository: https://d1yxz45j0ypngg.cloudfront.net/"
pip install numpy scipy cython joblib threadpoolctl

fi

python -m pip install $(get_dep threadpoolctl $THREADPOOLCTL_VERSION) \
$(get_dep pytest $PYTEST_VERSION) \
$(get_dep pytest-xdist $PYTEST_XDIST_VERSION)

if [[ "$COVERAGE" == "true" ]]; then
# XXX: coverage is temporary pinned to 6.2 because 6.3 is not fork-safe
# cf. https://github.com/nedbat/coveragepy/issues/1310
python -m pip install codecov pytest-cov coverage==6.2
fi

if [[ "$TEST_DOCSTRINGS" == "true" ]]; then
# numpydoc requires sphinx
python -m pip install sphinx
python -m pip install numpydoc
fi
}

Expand All @@ -184,7 +111,7 @@ scikit_learn_install() {
# 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
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
export AR=/usr/bin/ar
Expand Down Expand Up @@ -220,7 +147,7 @@ scikit_learn_install() {

main() {
pre_python_environment_install
python_environment_install
python_environment_install_and_activate
scikit_learn_install
}

Expand Down
Loading