From 5336a7e40a34ec1579dc9c4470a5f0e7bcd777bc Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Sun, 4 Aug 2024 14:03:44 -0400 Subject: [PATCH] pyproject.toml: Prefer NumPy 2.0 in build-system. Build against NumPy 2.0 in the build-system when possible (i.e., on Python 3.9 or later). This will create code that is compatible with both NumPy 1.x and 2.x, see: https://numpy.org/devdocs/dev/depending_on_numpy.html#numpy-2-0-specific-advice --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2b0e85a044..82ce83dab5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ requires = [ "oldest-supported-numpy; python_version<'3.7'", # we need to build with at least 1.16.5 for a limited API bugfix "numpy==1.16.5; python_version=='3.7'", - "oldest-supported-numpy; python_version>='3.8'" + "oldest-supported-numpy; python_version=='3.8'", + "numpy>=2,<3; python_version>='3.9'", ] build-backend = "setuptools.build_meta"