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

Forthcoming NumPy2.0 release #358

Open
ns-rse opened this issue Jan 10, 2024 · 0 comments
Open

Forthcoming NumPy2.0 release #358

ns-rse opened this issue Jan 10, 2024 · 0 comments

Comments

@ns-rse
Copy link
Contributor

ns-rse commented Jan 10, 2024

Numpy2 is due to be released later this year (first release candidate is scheduled 2024-02-01).

This may introduce some breaking changes, a broad overview is available here.

Mentioned in that article is that scikit-image has issues, which is indirect because the package has an optional dependency on matplotlib (I've discovered this whilst working on skan issues).

The official NumPy 2.0 migration guide — NumPy v2.0.dev0 Manual suggests that ruff can be leveraged to address the mentioned changes under Ruff Plugin.

To which end we may be able to check and anticipate any breaking changes by adding the following to pyproject.toml :

[tool.ruff.lint]
extend-select = ["NPY201"]
preview = true

Although I've tried this on another project and pre-commit complained that tool.ruff.lint was a duplicate (I think because I have other tool.ruff.lint.* sections already defined). What worked for me was adding the following...

[tool.ruff]
...
lint.extend-select = ["NPY201"]
preview = true

After adding this the checks should be run using the pre-commit hook

pre-commit run --all-files ruff
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

1 participant