diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8026996106d8b..42f35362a5739 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -67,6 +67,11 @@ jobs: - os: windows-latest python: 311 platform_id: win_amd64 + - os: windows-latest + python: 312 + platform_id: win_amd64 + # TODO: remove when Python 3.12 is released + prerelease: "True" # Linux 64 bit manylinux2014 - os: ubuntu-latest @@ -88,6 +93,12 @@ jobs: python: 311 platform_id: manylinux_x86_64 manylinux_image: manylinux2014 + - os: ubuntu-latest + python: 312 + platform_id: manylinux_x86_64 + manylinux_image: manylinux2014 + # TODO: remove when Python 3.12 is released + prerelease: "True" # MacOS x86_64 - os: macos-latest @@ -104,7 +115,10 @@ jobs: platform_id: macosx_x86_64 # MacOS arm64 - # The latest Python version is built and tested on CirrusCI + # 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 python: 38 platform_id: macosx_arm64 @@ -114,6 +128,9 @@ jobs: - os: macos-latest python: 310 platform_id: macosx_arm64 + - os: macos-latest + python: 311 + platform_id: macosx_arm64 steps: - name: Checkout scikit-learn @@ -128,6 +145,7 @@ jobs: env: CONFTEST_PATH: ${{ github.workspace }}/conftest.py CONFTEST_NAME: conftest.py + CIBW_PRERELEASE_PYTHONS: ${{ matrix.prerelease }} CIBW_ENVIRONMENT: SKLEARN_SKIP_NETWORK_TESTS=1 SKLEARN_BUILD_PARALLEL=3 CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} diff --git a/build_tools/cirrus/arm_wheel.yml b/build_tools/cirrus/arm_wheel.yml index 81acc7ed6a9fa..c5f5a34afa490 100644 --- a/build_tools/cirrus/arm_wheel.yml +++ b/build_tools/cirrus/arm_wheel.yml @@ -16,10 +16,17 @@ macos_arm64_wheel_task: # See `maint_tools/update_tracking_issue.py` for details on the permissions the token requires. BOT_GITHUB_TOKEN: ENCRYPTED[9b50205e2693f9e4ce9a3f0fcb897a259289062fda2f5a3b8aaa6c56d839e0854a15872f894a70fca337dd4787274e0f] matrix: - # Only the latest Python version is built and tested on CirrusCI, the other - # macos arm64 builds are on GitHub Actions + # Only the latest Python version is built and tested on Cirrus CI, the other + # macOS arm64 builds are on GitHub Actions. The reason is that macOS time is + # 5x more expensive than Linux times on Cirrus CI and the credits are limited + # (for free accounts). + # Note that the macOS arm64 builds are cross compiled on GitHub Actions (without + # running the tests) and while the macOS arm64 build for the latest Python version + # is actually tested on Cirrus CI. - env: - CIBW_BUILD: cp311-macosx_arm64 + CIBW_BUILD: cp312-macosx_arm64 + # TODO: remove when Python 3.12 is released + CIBW_PRERELEASE_PYTHONS: True conda_script: - curl -L --retry 10 -o ~/mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh @@ -68,6 +75,11 @@ linux_arm64_wheel_task: CIBW_TEST_SKIP: "*_aarch64" - env: CIBW_BUILD: cp311-manylinux_aarch64 + CIBW_TEST_SKIP: "*_aarch64" + - env: + CIBW_BUILD: cp312-manylinux_aarch64 + # TODO: remove when Python 3.12 is released + CIBW_PRERELEASE_PYTHONS: True cibuildwheel_script: - apt install -y python3 python-is-python3 diff --git a/build_tools/github/build_minimal_windows_image.sh b/build_tools/github/build_minimal_windows_image.sh index 4399bfa80704e..aa7bfc3e31f9f 100755 --- a/build_tools/github/build_minimal_windows_image.sh +++ b/build_tools/github/build_minimal_windows_image.sh @@ -14,6 +14,9 @@ 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}) +if [[ "$CIBW_PRERELEASE_PYTHONS" == "True" ]]; then + PYTHON_VERSION="$PYTHON_VERSION-rc" +fi # Build a minimal Windows Docker image for testing the wheels docker build --build-arg PYTHON_VERSION=$PYTHON_VERSION \ --build-arg WHEEL_NAME=$WHEEL_NAME \ diff --git a/setup.py b/setup.py index f9ae13c94502b..ae2a2f9ea41f6 100755 --- a/setup.py +++ b/setup.py @@ -593,6 +593,7 @@ def setup_package(): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ],