Skip to content

Restore numpy>1.x compatibility - #52

Merged
hjweide merged 1 commit into
hjweide:masterfrom
prina404:master
Feb 22, 2026
Merged

Restore numpy>1.x compatibility#52
hjweide merged 1 commit into
hjweide:masterfrom
prina404:master

Conversation

@prina404

Copy link
Copy Markdown
Contributor

Motivation

Proposal to partially revert the changes introduced in #49 in order to keep numpy 1.x compatibility.

My understanding of the error described in #49 is that the wheel was built with numpy 1.x, which is not forward-compatible with numpy 2.x.
But as long as the correct version is set with this option in pyproject.toml

[build-system]
requires = ["setuptools>=64", "wheel", "numpy>=2.0.0"]

we should be able to produce wheels that are backwards-compatible with 1.x. AFAIK, this is the standard approach to maintain compatibility (e.g. in SciPy's pyproject.toml)

Changes

Revert requirements.txt and NPY macros to version 1.21 (which should be the minimum numpy version for python 3.9)

Notes

I've tested these changes by building a linux wheel with cibuildwheel and running it succesfully in two different clean environments with numpy>=2.0 and numpy<2.0 respectively.

@prina404

Copy link
Copy Markdown
Contributor Author

cc @bluemellophone

@hjweide

hjweide commented Feb 22, 2026

Copy link
Copy Markdown
Owner

Thanks for the detailed explanation! Your reasoning makes sense to me. Are you using Python 3.9? I mean to remove Python 3.9 soon.

@hjweide
hjweide merged commit 8ba12ad into hjweide:master Feb 22, 2026
7 checks passed
@prina404

Copy link
Copy Markdown
Contributor Author

Are you using Python 3.9? I mean to remove Python 3.9 soon.

No, I'm currently using 3.11 for most of my work, so removing 3.9 won’t affect me 👍

@bluemellophone

Copy link
Copy Markdown
Contributor

Following up, this LGTM. Good call @prina404. I verified version 1.1.4 is still working with our downstream implementation.

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.

3 participants