Skip to content

Conversation

@rgommers
Copy link
Member

Now that we have https://github.com/numpy/numpy-release, we can remove most wheel build jobs from this repo and at the same time improve the default set of jobs running in CI by adding some wheel build jobs to the mix (none got run by default before this PR).

Up for discussion:

  • Exactly what do we run here? My first stab at it was 1 wheel per platform, minus the ones where we don't vendor OpenBLAS.
  • Do we run the full or fast test suite?
  • Are there other jobs we can clean up now because of overlap (like the linux_musl.yml one removed here)
  • Still TBD: how exactly do we deal with some remaining overlap between files in the numpy and numpy-release repos? xref Sync the code here with upstream numpy/numpy numpy-release#6 which @mattip just opened

@andyfaff
Copy link
Member

The linux_musl.yml file was supposed to be the place for examining musl, it just so happened to be built/installed through a wheel. I still think it makes sense to keep a musl linux run in this file, but we probably don't need to send it through a wheel first. We may find out at a later stage that we want to amend some options for such a test run.

What pain points do the full/fast runs tend to highlight? We should probably run full on numpy-releases (that gets triggered less), so we can probably run fast in the wheels here, and save some full runs for builds that don't go through wheel building.

@rgommers
Copy link
Member Author

rgommers commented Aug 12, 2025

What pain points do the full/fast runs tend to highlight?

I just had a look at what's decorated with mark.slow, and it's not that much - mostly f2py tests, I/O tests, some other compile tests, and static typing tests (which won't run by default anyway). So the extra value of running them on more then a handful of platforms is pretty low.

I still think it makes sense to keep a musl linux run in this file,

I really don't think it adds any value. It made a lot of sense when we did not run wheel build jobs on PRs, but when we run a musllinux x86-64 and aarch64 wheel build job already, the extra job is 100% duplicate.

Other jobs that can go, for the same reason, are:

  • the Windows x86-64 and arm64 ones that build with scipy-openblas64 in windows.yml
  • the plain Linux one on ubuntu-22.04-arm in linux.yml

If we remove all those, that still leaves us with four extra jobs after this PR, which seems acceptable for the win of testing wheel builds by default.

Still TBD: how exactly do we deal with some remaining overlap between files in the numpy and numpy-release repos?

Still thinking about this. Less duplication is good for maintainability. We need to have at least some files in this repo so we can do wheel builds. We don't need the licensing related stuff here, because we're not distributing wheels from this repo anymore, and there's a benefit to removing it (e.g., no license checkers will notice LGPL etc. in this repo and raise flags by default).

The main things that leaves are:

  1. cibw_before_build.sh, cibw_test_command.sh and repair_windows.sh
  2. the pyproject.toml cibuildwheel config
  3. requirements files

I'm inclined to say for (1) that we avoid duplication and use the files in this repo from numpy-release. For (2) the configs are slightly different (e.g., pyodide is added), but could be reused. For (3) it's best kept separate with a check on no mismatches probably, and ensuring the numpy-release ones are minimal; the ones in this repo are very messy with many unnecessary build and test dependencies added.

This accounts for the actual release builds moving to the separate
`numpy-release` repo. We want to keep a decent subset of wheel builds
in the main repo and always run them, just like other CI jobs that
test some config that matters.
These configs are covered by `wheels.yml`, which is now part
of the regular test suite rather than off-by-default on PRs.
@rgommers rgommers marked this pull request as ready for review September 9, 2025 19:40
@rgommers
Copy link
Member Author

rgommers commented Sep 9, 2025

This is ready now. I went with the full test suite for now, since the extra time is only a couple of minutes per job and I'd like to avoid testing the slow tests on niche architectures in numpy-release only for now.

# at it in `repair_windows.sh` (needed only on Windows because of the lack
# of RPATH support).
if [[ $RUNNER_OS == "Windows" ]]; then
python <<EOF
Copy link
Member

Choose a reason for hiding this comment

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

This bit is a little complicated to follow for me because the indentation is changing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this took me a while. The old version was super confusing, it was unclear when reading the code that PKG_CONFIG_PATH was not an environment variable.

The diff is hard to read; just looking at the old and new versions side by side should be helpful. What it does isn't changing IIRC, the new version should just be easier to understand.

Copy link
Member

Choose a reason for hiding this comment

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

+1 from me, as the previous version's author

Copy link
Member

Choose a reason for hiding this comment

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

When the licences are removed we're losing a record of the code that's being bundled (OpenBLAS, etc).
pyproject.toml says

The licenses for these vendored components are dynamically included in the build process for PyPI wheels.

I can see these files are now in numpy-release, but isn't it important to have a record of them here somewhere. Are there going to be improvements in how we bundle these extra licences in the wheel build process?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's actually somewhat important to not have GPL licenses in this repo, because there is nothing inside this repo that's GPL, LGPL or otherwise copyleft.

I'd really like to conceptually separate NumPy the project and how its sources are licensed - which matters to anyone building/redistributing numpy - and wheels on PyPI, which are only one way of distributing numpy, and a quite unusual way at that. If you get numpy from any other source than PyPI, it will not contain copyleft components.

Are there going to be improvements in how we bundle these extra licences in the wheel build process?

Hopefully yes. See numpy/numpy-release#11

PKG_CONFIG_PATH="/project/.openblas"
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/project/.openblas/lib"

[tool.cibuildwheel.macos]
Copy link
Member

Choose a reason for hiding this comment

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

So these entries are being removed because we only need them in numpy-release now?

Copy link
Member Author

Choose a reason for hiding this comment

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

No we still have macOS wheel builds here in wheels.yml. I actually improved how this bundling works, so messing with DYLD_LIBRARY_PATH is no longer necessary. If you look at https://github.com/numpy/numpy-release/blob/main/cibuildwheel.toml, you won't find a macos entry there either.

- [ubuntu-22.04-arm, manylinux_aarch64, ""]
- [ubuntu-22.04-arm, musllinux_aarch64, ""]
- [macos-13, macosx_x86_64, openblas]
- [macos-13, macosx_x86_64, accelerate]
Copy link
Member

Choose a reason for hiding this comment

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

Did you want to remove all macos-13 runs here?

Copy link
Member

Choose a reason for hiding this comment

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

Should we move them to azure where there are still native macos x86_64 runners?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can we do that separately based on what comes out of the discussion at gh-29728?

I haven't yet looked into what Azure plans to do with their platform support. Also, I hope we'll get rid of Azure completely ....

Copy link
Member Author

Choose a reason for hiding this comment

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

For this one, my thinking was that there's another job that tests Accelerate LP64 and ILP64 at once (see here, plus this particular job is quite slow, so I wanted to remove this one as duplicate.

@andyfaff
Copy link
Member

I'm happy for this to be merged. I'll do so tomorrow morning if it's not done by then.

@mattip mattip merged commit 295a14a into numpy:main Sep 10, 2025
76 checks passed
@mattip
Copy link
Member

mattip commented Sep 10, 2025

Thanks @rgommers

@rgommers rgommers deleted the ci-wheels-cleanup branch September 10, 2025 11:08
@rgommers
Copy link
Member Author

Thanks for the reviews! Let me look at the last open comment about the python64bit_openblas_winarm64 job as a potential follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants