MAINT/BLD: NumPy 2.0 Support #530
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds build-time and runtime support for NumPy 2.0. This version is C-API compatible with NumPy 1.x, so we set a build-time requirement for >=2.0 while retaining support for 1.x. This compatibility guarantee allows us to deprecate the usage of
oldest-supported-numpyper the recommendation of those authors.NumPy 2.0 does not support Python 3.8, but these changes do not directly impact our ability to support py38 on NumPy 1.x. (It is probably overdue for pycalphad to drop py38 support, but that can be done separately from here.)
Two minor and backwards-compatible fixes for runtime are needed and also added here:
np.float_is renamed tonp.float64andnp.complex_is renamed tonp.complex128. (Complex number arrays are used for certain tests.)See also:
Checklist
setup.py(runtime requirements)pyproject.toml(build requirements)requirements-dev.txt(build and development requirements)