Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CI Add Python 3.12 build #26886

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,28 @@ jobs:
LOCK_FILE: './build_tools/azure/python_nogil_lock.txt'
COVERAGE: 'false'

- template: build_tools/azure/posix-docker.yml
# Python development version build
parameters:
name: Linux_Python_dev
vmImage: ubuntu-20.04
dependsOn: [git_commit, linting]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
or(eq(variables['Build.Reason'], 'Schedule'),
contains(dependencies['git_commit']['outputs']['commit.message'], '[python-dev]'
)
)
)
matrix:
pylatest_pip_python_dev:
DOCKER_CONTAINER: 'python:3.12-rc'
DISTRIB: 'pip-python-dev'
LOCK_FILE: './build_tools/azure/python_dev_lock.txt'
COVERAGE: 'false'

- template: build_tools/azure/posix-docker.yml
parameters:
name: Linux_Nightly_PyPy
Expand Down
4 changes: 2 additions & 2 deletions build_tools/azure/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ python_environment_install_and_activate() {
source $VIRTUALENV/bin/activate
pip install -r "${LOCK_FILE}"

elif [[ "$DISTRIB" == "pip-nogil" ]]; then
elif [[ "$DISTRIB" == "pip"* ]]; then
python -m venv $VIRTUALENV
source $VIRTUALENV/bin/activate
pip install -r "${LOCK_FILE}"
Expand All @@ -76,7 +76,7 @@ python_environment_install_and_activate() {
echo "Installing pillow from latest sources"
pip install https://github.com/python-pillow/Pillow/archive/main.zip

elif [[ "$DISTRIB" == "pip-nogil" ]]; then
elif [[ "$DISTRIB" == "pip"* ]]; then
apt-get -yq update
apt-get install -yq ccache

Expand Down
38 changes: 38 additions & 0 deletions build_tools/azure/python_dev_lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --output-file=/scikit-learn/build_tools/azure/python_dev_lock.txt /scikit-learn/build_tools/azure/python_dev_requirements.txt
#
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple

cython==3.0.0
# via -r /scikit-learn/build_tools/azure/python_dev_requirements.txt
execnet==2.0.2
# via pytest-xdist
iniconfig==2.0.0
# via pytest
joblib==1.3.1
# via -r /scikit-learn/build_tools/azure/python_dev_requirements.txt
numpy==2.0.0.dev0
# via
# -r /scikit-learn/build_tools/azure/python_dev_requirements.txt
# scipy
packaging==23.1
# via pytest
pluggy==1.2.0
# via pytest
pytest==7.4.0
# via
# -r /scikit-learn/build_tools/azure/python_dev_requirements.txt
# pytest-xdist
pytest-xdist==3.3.1
# via -r /scikit-learn/build_tools/azure/python_dev_requirements.txt
scipy==1.12.0.dev0
# via -r /scikit-learn/build_tools/azure/python_dev_requirements.txt
threadpoolctl==3.2.0
# via -r /scikit-learn/build_tools/azure/python_dev_requirements.txt

# The following packages are considered to be unsafe in a requirements file:
setuptools==68.0.0
# via -r /scikit-learn/build_tools/azure/python_dev_requirements.txt
14 changes: 14 additions & 0 deletions build_tools/azure/python_dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To generate python_dev_lock.txt, use the following command:
# docker run -v $PWD:/scikit-learn -it python:3.12-rc bash -c 'pip install pip-tools; pip-compile --allow-unsafe --upgrade /scikit-learn/build_tools/azure/python_dev_requirements.txt -o /scikit-learn/build_tools/azure/python_dev_lock.txt'
# TODO: remove --extra-index-url and --pre when there are numpy and scipy
# releases that supports Python 3.12
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
--pre
numpy
scipy
cython
setuptools
joblib
threadpoolctl
pytest
pytest-xdist
8 changes: 3 additions & 5 deletions build_tools/azure/test_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

set -e

if [[ "$DISTRIB" =~ ^conda.* ]]; then
source activate $VIRTUALENV
elif [[ "$DISTRIB" == "ubuntu" || "$DISTRIB" == "pip-nogil" ]]; then
source $VIRTUALENV/bin/activate
fi
# Defines the show_installed_libraries and activate_environment functions.
source build_tools/shared.sh

activate_environment
make test-doc
3 changes: 2 additions & 1 deletion build_tools/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ show_installed_libraries(){
activate_environment() {
if [[ "$DISTRIB" =~ ^conda.* ]]; then
source activate $VIRTUALENV
elif [[ "$DISTRIB" == "ubuntu" || "$DISTRIB" == "debian-32" || "$DISTRIB" == "pip-nogil" ]]; then
elif [[ "$DISTRIB" == "ubuntu" || "$DISTRIB" == "debian-32" \
|| "$DISTRIB" == "pip"* ]]; then
source $VIRTUALENV/bin/activate
fi
}