Repository navigation
Conversation
ebc93cc to
3975104
Compare
|
@lesteve you might want to try out cibuildwheel v4 that came out recently: https://iscinumpy.dev/post/cibuildwheel-4-0-0/ while we're at it. Also, is there a chance the pre-cibuildwheel setup can be moved to cibuildwheel's before-build (and/or before-build-macos, etc.) step? That would make it easier to run cibuildwheel and produce wheels locally. |
…cOS cibuildwheel does not use a container
|
Thanks for your feedback @agriyakhetarpal, I tried to use cibuildwheel 4.0.0, let's see 🤞.
I don't think so, because you need to set environment variables like |
|
Thanks @lesteve, looks like this is working well! Minus the Windows Docker engine not being there and an unrelated test failure on macOS.
Oh, I think it can be moved, as you should be able to define these variables within the build script and pass them along. The problem with the approach would have been the OpenMP download occurring multiple times, but that cannot really happen here as the job is parameterised across Python versions – unlike workflows elsewhere where cibuildwheel installs and manages its own Python and builds from the earliest to the latest supported Python version (and thus runs - name: Build and test wheels
uses: pypa/cibuildwheel@f03ac7617d6cff873ccf24cc0d567ef5ba5a9e6d # v4.0.0
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_ARCHS: all
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
# Needed on Windows CI to compile with Visual Studio compiler
# otherwise Meson detects a MINGW64 platform and use MINGW64
# toolchain
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--vsenv"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir}
CIBW_BEFORE_BUILD: bash {project}/build_tools/wheels/cibw_before_build.sh {project}
CIBW_BEFORE_BUILD_MACOS: |
set -e
if [ "$(uname -m)" = "arm64" ]; then
OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-arm64/llvm-openmp-11.1.0-hf3c4609_1.tar.bz2"
else
OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-64/llvm-openmp-11.1.0-hda6cdc1_1.tar.bz2"
fi
"$HOME/miniconda3/bin/conda" create -y -n build "$OPENMP_URL"
bash {project}/build_tools/wheels/cibw_before_build.sh {project}
CIBW_ENVIRONMENT_MACOS: >-
PREFIX="$HOME/miniconda3/envs/build"
MACOSX_DEPLOYMENT_TARGET=$([ "$(uname -m)" = "arm64" ] && echo 12.0 || echo 10.9)
CC=/usr/bin/clang
CXX=/usr/bin/clang++
CPPFLAGS="-Xpreprocessor -fopenmp"
CFLAGS="-I$PREFIX/include"
CXXFLAGS="-I$PREFIX/include"
LDFLAGS="-Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -lomp"
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{matrix.platform_id}}
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS
# TODO Put back pandas when there is a pandas release with Python 3.14 wheels
CIBW_TEST_REQUIRES: ${{ contains(matrix.python, '314') && 'pytest' || 'pytest pandas' }} scipy
# On Windows, we use a custom Docker image and CIBW_TEST_REQUIRES_WINDOWS
# does not make sense because it would install dependencies in the host
# rather than inside the Docker image
CIBW_TEST_REQUIRES_WINDOWS: ""
CIBW_TEST_COMMAND: bash {project}/build_tools/wheels/test_wheels.sh {project}
CIBW_TEST_COMMAND_WINDOWS: bash {project}/build_tools/github/test_windows_wheels.sh ${{ matrix.python }} {project} ${{matrix.platform_id}}
CIBW_BUILD_VERBOSITY: 1 |
|
I see, but then there are also other environment variables Footnotes
|
|
@thomasjpfan I think this is ready for review if you want to have a look. The free-threaded wheel CI failures (Windows + macOS) are not related and seemed genuine ... There may be more opportunities to move things from |
|
This switch was made in the WIP isolated release repo at: https://github.com/scikit-learn/scikit-learn-release. I am not sure if it's worth improving the release workflow in the main dev repo or if we should directly implement those changes in the new repo. |
|
I checked the diff of this PR and I think most of the improvements have been identically or very similarly implemented in https://github.com/scikit-learn/scikit-learn-repo. |
|
Closing this one, since a similar thing has already been done in https://github.com/scikit-learn/scikit-learn-release. |
The advantage is that the cibuildwheel is pinned in the yaml, rather than from the latest version in PyPI.
The context is creating a scikit-learn-release repo similarly to https://github.com/numpy/numpy-release and https://github.com/numpy/scipy-release. This would remove one our custom quirk that I noticed.