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

pybigtools: NumPy 2.0 #43

Closed
nvictus opened this issue Jun 17, 2024 · 6 comments
Closed

pybigtools: NumPy 2.0 #43

nvictus opened this issue Jun 17, 2024 · 6 comments

Comments

@nvictus
Copy link
Collaborator

nvictus commented Jun 17, 2024

Numpy just released its 2.0, which includes ABI breaks, and a migration guide. We should check that nothing breaks or pin numpy < 2 until migration is complete.

@nvictus
Copy link
Collaborator Author

nvictus commented Jul 4, 2024

Re: ABI compatibility

https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-0-specific-advice

When you build wheels for your package using a NumPy 2.x version at build time, those will work with NumPy 1.xx.

So for pybigtools, we want a numpy 2.x dependency at build time. i.e.:

[build-system]
requires = ["maturin>=1.0,<2.0",  "numpy>=2.0,<3.0"]
build-backend = "maturin"
...

@jackh726
Copy link
Owner

jackh726 commented Jul 4, 2024

That seems fine - I did a bit of testing and didn't encounter any problems.

@nvictus
Copy link
Collaborator Author

nvictus commented Jul 4, 2024

I take it back. For pyO3-based bindings, the build time dependency that matters is rust-numpy.

@nvictus
Copy link
Collaborator Author

nvictus commented Nov 28, 2024

It's still not clear to me whether or not there could be ABI incompatibility between pybigtools and a Python environment that uses numpy 2.0. However, pybigtools currently depends on rust-numpy 0.19, which are bindings to the NumPy 1.xx C API.

We should probably bump rust-numpy to 0.22 or later, which supports NumPy 2.0 which supports both ABIs.

@jackh726
Copy link
Owner

I've upgraded to rust-numpy 0.22 on master.

@jackh726
Copy link
Owner

The pybigtools v0.2.4 release contains rust-numpy 0.22, so closing this.

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