Skip to content
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

Limit numpy version to < 2 in install_requires and make another post release #433

Open
vsnever opened this issue Aug 4, 2024 · 1 comment

Comments

@vsnever
Copy link
Contributor

vsnever commented Aug 4, 2024

Raysect's build requirements specify oldest-supported-numpy, which is 1.14, while install_requires sets the NumPy version to numpy>=1.14, which installs NumPy 2.0 in Python 3.9 and above. Since NumPy 2.0 and 1.x are not binary compatible, trying to run any Raysect code produces errors like this:

ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

I propose to constrain the NumPy version to 1.x in setup.py and make another post release.

@jacklovell
Copy link
Contributor

Building with Numpy 2.0 provides backwards compatibility with runtime 1.x. So I think it'd actually be better to update pyproject.toml to use numpy~=2.0 for Python 3.9 and later, and oldest-supported-numpy for Python 3.8 and earlier. That would additionally mean packages depending on Raysect wouldn't have to pin to Numpy 1.x either on newer Pythons.

I don't know whether it's worth also updating install_requires, since building with Numpy 1.x on 3.8 and earlier wouldn't be an issue as Numpy 2.0 isn't available at runtime on 3.8 and earlier (without a user trying rather hard to get it installed, at which point they should expect problems!).

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

No branches or pull requests

2 participants