Skip to content
Merged
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
11 changes: 9 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ jobs:
uses: pypa/cibuildwheel@f03ac7617d6cff873ccf24cc0d567ef5ba5a9e6d # v4.0.0
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_BEFORE_TEST_WINDOWS: bash tools/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.platform_id }}
CIBW_TEST_COMMAND_WINDOWS: bash {project}/tools/test_windows_wheels.sh ${{ matrix.python }} {project} ${{ matrix.platform_id }}
SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }}
PYTHONHASHSEED: "0"
CIBW_ENVIRONMENT_PASS_LINUX: SOURCE_DATE_EPOCH PYTHONHASHSEED RUNNER_OS
Expand All @@ -184,6 +182,15 @@ jobs:
output-dir: dist
config-file: cibuildwheel.toml

# Running in a minimal Docker image makes sure that we bundled correctly
# the shared libraries for MSVC C++ runtime and OpenMP in the Windows
# wheel
- name: Test Windows wheel in a minimal Docker image
# Currently Windows ARM64 runners do not have Docker support and there
# is no Docker image with free-threaded
if: ${{ matrix.platform_id == 'win_amd64' && !contains(matrix.python, 't') }}
run: bash tools/test_windows_wheels_in_docker.sh ${{ matrix.python }}

- name: Store artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
4 changes: 0 additions & 4 deletions cibuildwheel.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@ test-command = "bash {project}/tools/test_wheels.sh {project}"
# toolchain
config-settings = "setup-args=--vsenv"
repair-wheel-command = "bash tools/repair_windows_wheels.sh {wheel} {dest_dir}"
# On Windows, we use a custom Docker image and the test dependencies are
# installed inside the Docker image rather than on the host, so there are no
# test requirements to install here.
test-requires = []
48 changes: 0 additions & 48 deletions tools/build_minimal_windows_image.sh

This file was deleted.

41 changes: 0 additions & 41 deletions tools/test_windows_wheels.sh

This file was deleted.

27 changes: 27 additions & 0 deletions tools/test_windows_wheels_in_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -e
set -x

PYTHON_VERSION=$1

WHEEL_PATH=$(ls dist/*.whl)

# Dot the Python version for identifying the base Docker image.
PYTHON_DOCKER_IMAGE_PART="${PYTHON_VERSION:0:1}.${PYTHON_VERSION:1:2}"

DOCKER_IMAGE="winamd64/python:${PYTHON_DOCKER_IMAGE_PART}-windowsservercore"
MNT_FOLDER="C:/mnt"
CONTAINER_ID=$(docker run -it -v "$(cygpath -w "$PWD"):$MNT_FOLDER" -d "$DOCKER_IMAGE")

function exec_inside_container() {
docker exec "$CONTAINER_ID" powershell -Command "$1"
}

exec_inside_container "python -m venv C:/venv"
exec_inside_container "C:/venv/Scripts/python -m pip install $MNT_FOLDER/$WHEEL_PATH"
exec_inside_container "C:/venv/Scripts/python -c 'import sklearn; sklearn.show_versions()'"
# Running the estimator checks is a good enough check to make sure we bundled
# correctly the shared libraries on Windows, while still being reasonably fast
# to run.
exec_inside_container "C:/venv/Scripts/python -m sklearn.utils.tests.test_estimator_checks"
Loading