Skip to content

CI Build the wheels for PyPy #18879

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 15 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
13 changes: 10 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

# Build the wheels for Linux, Windows and macOS for Python 3.6 and newer
build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
name: Build wheel for ${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
needs: check_build_trigger
if: needs.check_build_trigger.outputs.build
Expand All @@ -46,7 +46,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python: [36, 37, 38, 39]
python: [cp36, cp37, cp38, cp39, pp36]
bitness: [32, 64]
include:
# Run 32 and 64 bit version in parallel for Linux and Windows
Expand All @@ -66,6 +66,13 @@ jobs:
bitness: 64
platform_id: macosx_x86_64
exclude:
- os: windows-latest
python: pp36
- os: ubuntu-latest
bitness: 32
python: pp36
- os: macos-latest
python: pp36
- os: macos-latest
bitness: 32

Expand All @@ -85,7 +92,7 @@ jobs:
OPENBLAS_NUM_THREADS=2
SKLEARN_SKIP_NETWORK_TESTS=1
SKLEARN_BUILD_PARALLEL=3
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir} ${{ matrix.bitness }}
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.bitness }}
CIBW_TEST_REQUIRES: pytest pandas threadpoolctl
Expand Down
10 changes: 5 additions & 5 deletions build_tools/github/build_minimal_windows_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set -x
PYTHON_VERSION=$1
BITNESS=$2

if [[ "$PYTHON_VERSION" == "36" || "$BITNESS" == "32" ]]; then
# Python 3.6 and 32-bit architectures are not supported
# by the official Docker images: Tests will just be run
# on the host (instead of the minimal Docker container).
if [[ $PYTHON_VERSION =~ [cp]p36 || $BITNESS == 32 ]]; then
# CPython 3.6, PyPy and 32-bit architectures are not supported
# by the official Docker images yet: Tests will just be run on
# the running host (instead of the minimal Docker container).
exit 0
fi

Expand All @@ -20,7 +20,7 @@ WHEEL_NAME=$(basename $WHEEL_PATH)
cp $WHEEL_PATH $WHEEL_NAME

# Dot the Python version for identyfing the base Docker image
PYTHON_VERSION=$(echo ${PYTHON_VERSION:0:1}.${PYTHON_VERSION:1:2})
PYTHON_VERSION=$(echo ${PYTHON_VERSION:2:1}.${PYTHON_VERSION:3})

# Build a minimal Windows Docker image for testing the wheels
docker build --build-arg PYTHON_VERSION=$PYTHON_VERSION \
Expand Down
2 changes: 1 addition & 1 deletion build_tools/github/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -x

# OpenMP is not present on macOS by default
if [[ "$RUNNER_OS" == "macOS" ]]; then
if [[ $RUNNER_OS == macOS ]]; then
brew install libomp
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
Expand Down
4 changes: 2 additions & 2 deletions build_tools/github/check_build_trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -x
COMMIT_MSG=$(git log --no-merges -1 --oneline)

# The commit marker "[cd build]" will trigger the build when required
if [[ "$GITHUB_EVENT_NAME" == schedule ||
"$COMMIT_MSG" =~ \[cd\ build\] ]]; then
if [[ $GITHUB_EVENT_NAME == schedule ||
$COMMIT_MSG =~ \[cd\ build\] ]]; then
echo "::set-output name=build::true"
fi
2 changes: 1 addition & 1 deletion build_tools/github/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e
set -x

if [[ "$OSTYPE" != "linux-gnu" ]]; then
if [[ $OSTYPE != linux-gnu ]]; then
# The Linux test environment is run in a Docker container and
# it is not possible to copy the test configuration file (yet)
cp $CONFTEST_PATH $CONFTEST_NAME
Expand Down
6 changes: 3 additions & 3 deletions build_tools/github/test_windows_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ set -x
PYTHON_VERSION=$1
BITNESS=$2

if [[ "$PYTHON_VERSION" == "36" || "$BITNESS" == "32" ]]; then
# For Python 3.6 and 32-bit architecture use the regular
# test command (outside of the minimal Docker container)
if [[ $PYTHON_VERSION =~ [cp]p36 || $BITNESS == 32 ]]; then
# For CPython 3.6, PyPy and 32-bit architecture use the
# regular test command outside of the Docker container.
cp $CONFTEST_PATH $CONFTEST_NAME
pytest --pyargs sklearn
python -m threadpoolctl -i sklearn
Expand Down
2 changes: 1 addition & 1 deletion build_tools/github/upload_anaconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e
set -x

if [ "$GITHUB_EVENT_NAME" == "schedule" ]; then
if [ $GITHUB_EVENT_NAME == schedule ]; then
ANACONDA_ORG="scipy-wheels-nightly"
ANACONDA_TOKEN="$SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN"
else
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ requires = [
"wheel",
"Cython>=0.28.5",

# PyPy needs numpy >= 1.14.0
# PyPy needs numpy >= 1.19.0
# platform_python_implementation!='CPython' not needed >= Python 3.7 which is numpy 1.14.5
"numpy==1.13.3; python_version=='3.6' and platform_machine!='aarch64' and platform_system!='AIX' and platform_python_implementation=='CPython'",
"numpy==1.14.0; python_version=='3.6' and platform_machine!='aarch64' and platform_system!='AIX' and platform_python_implementation!='CPython'",
"numpy==1.19.0; python_version=='3.6' and platform_machine!='aarch64' and platform_system!='AIX' and platform_python_implementation!='CPython'",

# AIX needs numpy >= 1.16.0
# platform_system!='AIX' not needed >= Python 3.8 which is numpy 1.17.3
Expand Down
2 changes: 1 addition & 1 deletion sklearn/_min_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# numpy scipy and cython should by in sync with pyproject.toml
if platform.python_implementation() == 'PyPy':
SCIPY_MIN_VERSION = '1.1.0'
NUMPY_MIN_VERSION = '1.14.0'
NUMPY_MIN_VERSION = '1.19.0'
else:
SCIPY_MIN_VERSION = '0.19.1'
NUMPY_MIN_VERSION = '1.13.3'
Expand Down