From 1e0be34bbacbf8398f03e574717b6f9081e743a8 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Wed, 19 Jun 2024 16:38:02 +0100 Subject: [PATCH] Specify numpy versions properly to build for both 2.0 and 1.0 --- pyproject.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7ce4790..38c9c13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,12 @@ [build-system] -requires = ["setuptools>=49.5.0", "pybind11", "cmake"] +requires = [ + # Building with numpy 2.0 is compatible with numpy 1.x, but it + # is only available on Python 3.9+ + "numpy >= 2.0.0; python_version > '3.8'", + "oldest-supported-numpy; python_version <= '3.8'", + "setuptools>=49.5.0", + "pybind11", + "cmake" +] build-backend = "setuptools.build_meta"