Skip to content
Merged
Changes from 1 commit
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
35 changes: 29 additions & 6 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,35 @@ jobs:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
env:
CIBW_BEFORE_BUILD: >-
pip install numpy>=1.25 &&
rm -rf {package}/build
CIBW_BEFORE_BUILD_WINDOWS: >-
pip install delvewheel numpy>=1.25 &&

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure why the numpy install ahead of time. I tried this a bit (but no artifacts yet) and it works, but I don't see in the log whether the correct numpy got installed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was added when we were having problems with oldest-supported-numpy (and decided to fix them by switching to the np 1.25+ backwards compatible builds)

I think that it is likely we haven't needed it on this line since we switched to meson/pyproject.toml, but it did get changed in #26443.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but if we are using build isolation the wheel build won't see this numpy instal....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we have build isolation by default in cibuildwheel, but I am not sure what the default does exactly.

rm -rf {package}/build
# The following commands branch based on whether we are on the main
# branch or have a PR into main. For these, we use the NumPy 2.0
# nightlies to ensure future C-API/ABI compatibility.
# This branching becomes unnecessary when NumPy 2.0 is released.
# When using no-build-isolation we need to install all requirements.
CIBW_BEFORE_BUILD:
${{ (((github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'pull_request' && github.base_ref == 'refs/heads/main')) &&
'pip install meson-python pybind11 setuptools_scm "setuptools>=64" ninja &&
pip install "numpy>=2.0.0.dev0" --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" &&
rm -rf {package}/build'
) ||
'pip install "numpy>=1.25" &&
rm -rf {package}/build'
}}
CIBW_BEFORE_BUILD_WINDOWS:
${{ (((github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'pull_request' && github.base_ref == 'refs/heads/main')) &&
Comment thread
seberg marked this conversation as resolved.
Outdated
'pip install delvewheel meson-python pybind11 setuptools_scm "setuptools>=64" ninja &&
pip install "numpy>=2.0.0.dev0" --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" &&
rm -rf {package}/build'
) ||
'pip install delvewheel "numpy>=1.25" &&
rm -rf {package}/build'
}}
CIBW_BUILD_FRONTEND: >-
${{ (((github.event_name == '' && github.ref == 'refs/heads/main') ||
Comment thread
seberg marked this conversation as resolved.
Outdated
(github.event_name == 'pull_request' && github.base_ref == 'refs/heads/main')) &&
'pip; args: --no-build-isolation') || 'build' }}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair -w {dest_dir} {wheel}
CIBW_AFTER_BUILD: >-
Expand Down