Skip to content

bindings/python: use Numpy 2.x; update wheel builds#20

Merged
arahlin merged 4 commits intoketiltrout:masterfrom
gsmecher:python-numpy-2
Dec 17, 2025
Merged

bindings/python: use Numpy 2.x; update wheel builds#20
arahlin merged 4 commits intoketiltrout:masterfrom
gsmecher:python-numpy-2

Conversation

@gsmecher
Copy link
Contributor

This PR shifts the Python bindings from the Numpy 1.x to Numpy 2.x API. See the following for context:

https://numpy.org/doc/stable/numpy_2_0_migration_guide.html
https://numpy.org/doc/2.0/dev/depending_on_numpy.html

Numpy 2.x is now a better choice than 1.x for modules:

  • the ABI is backwards compatible (as far as 1.7), and
  • newer Python versions are not compatible with 1.x.

It makes sense to shift getdata in the same direction too. Along the way, I've refreshed the wheel build (to repair deprecated MacOS builders, to enable Python 3.13, and to deprecate 3.8.)

Comments welcome. While the build succeeds and regression tests pass, I have not used these code "in anger". I do plan to follow up this PR with a wheel builder for Windows, and think Numpy 2.x is a better basis for this work.

Because Numpy 2.x shared libraries are ABI compatible back to Numpy 1.x,
this requires a newer build environment to produce the Python bindings,
but the resulting library is backwards compatible. (This is ideal for a
wheel-based flow.)
@gsmecher
Copy link
Contributor Author

@ketiltrout and @arahlin, sorry to drop this on you before the holidays. This is a precursor to #21.

@arahlin
Copy link
Collaborator

arahlin commented Dec 17, 2025

I think the footprint of this PR is relatively small and otherwise simplifies python wheels and forward compatibility a great deal.

@arahlin arahlin merged commit a32659b into ketiltrout:master Dec 17, 2025
12 checks passed
arahlin pushed a commit that referenced this pull request Feb 6, 2026
…Windows wheels (#21)

This PR builds on the previous one (#20), so while it's a big change,
it's not as sprawling as it seems.

My primary motivation is getting Windows wheels built for pygetdata.
This created a fair cascade of tasks because:
- autotools only works on UNIX-like environments (including
MSYS2/cygwin), but
- on Windows, native Python .pyd modules are really only supported using
MSVC
- If we do that, the MacOS and Linux wheel builders should come along
for the ride.

Practically speaking, native Windows support needs CMake instead of
autotools, and switching the MacOS/Linux wheel builders at the same time
makes sense. The autotools flow remains in place (and the github
regression tests still pass against it.)

This PR contains a mix of "omnibus commits" (an incremental
modernization of the CMake infrastructure does not make sense) and
"drive-by commits" for individual bug fixes or improvements.

Note that we have definitely left Python 2.x behind (Numpy 2.x never
supported it anyways).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants