Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support NumPy 2.0 #120

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

Closed
jakirkham opened this issue May 31, 2024 · 7 comments
Closed

Support NumPy 2.0 #120

jakirkham opened this issue May 31, 2024 · 7 comments

Comments

@jakirkham
Copy link

Hi All πŸ‘‹

NumPy is planning to release 2.0 on June 16th ( numpy/numpy#24300 (comment) ). NumPy 2.0.0 RC packages for conda & wheels came out at the beginning of April ( numpy/numpy#24300 (comment) )

NumPy has put out a migration guide. More details are in the release notes

If scikit-sparse makes use of NumPy's C API (and produces wheels that use it), having a release of scikit-sparse with wheels built against NumPy 2.0.0rc1 would be helpful to ensure NumPy 1 & 2 compatible wheels (as wheels built against NumPy 1 won't be compatible with NumPy 2). More details in this NumPy 2 ABI doc

Also as NumPy is tracking ecosystem support for NumPy 2.0, it would be helpful to share scikit-sparse current support status in issue (with any plans): numpy/numpy#26191

@AaronDJohnson
Copy link
Collaborator

Thanks for bringing this issue up!

I don't know if there's anything to be done here. The migration guide recommends using the ruff plugin: ruff check path/to/code/ --select NPY201. Upon using this command, I get "All checks passed!"

It looks like the current release version (the one that I checked) never made it to PyPI, because the deployment failed. I'll work on this today. Once it's up, I think we can add ourselves to the ecosystem support list.

@rgommers
Copy link

One important thing to do is to fix the build-time metadata: https://github.com/scikit-sparse/scikit-sparse/blob/master/pyproject.toml#L33. You should depend on numpy>=2.0.0 for Python 3.9 and up, as documented at https://numpy.org/devdocs/dev/depending_on_numpy.html#numpy-2-0-specific-advice. That way you'll get wheels that are 1.x and 2.x compatible.

@AaronDJohnson
Copy link
Collaborator

Thanks, @rgommers. I'll work on it.

@jakirkham
Copy link
Author

Probably will want a release as well that includes those rebuilt wheels (with the metadata changes Ralf suggested)

@rgommers
Copy link

The support has been present in the master branch for 9 months now, and seems fine. Sorry to ping again, but any chance we can have a new release? It looks like releases are sdist-only, so should be quick and easy?

@AaronDJohnson
Copy link
Collaborator

AaronDJohnson commented Apr 22, 2025

Thanks for mentioning this @rgommers! I had a family event right around the time that I was working on this and forgot to make a new release. I've set the release now, and I'll make sure that it goes to PyPI.

@rgommers
Copy link

rgommers commented May 3, 2025

I see the 0.4.16 release is up, thanks @AaronDJohnson! This issue can be closed now I think?

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

3 participants