Skip to content

BLD: Use NumPy nightly wheels for non-release builds #27204

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

Merged
merged 5 commits into from
Oct 30, 2023
Merged
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: 11 additions & 2 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,20 @@ jobs:
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
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
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
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
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.

pip install delvewheel &&
rm -rf {package}/build
# Live on the edge when building on main or a PR against main since
# these wheels are also used for nightlies and NumPy 2.0 transition
# requires using the NumPy 2.0 nightlies for compatibility.
# If using all `--pre` releases creates issues, the NumPy wheel can be
# istalled more targeted.
CIBW_BUILD_FRONTEND: >-
${{ (((github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'pull_request' && github.base_ref == 'main')) &&
'pip; args: --pre --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"') ||
'build' }}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair -w {dest_dir} {wheel}
CIBW_AFTER_BUILD: >-
Expand Down