From 846d3295a21fdf5626a582079cdf55d13e734d36 Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Fri, 22 Sep 2023 22:50:21 +0100 Subject: [PATCH] Pin Numpy < 2 in requirements (#10893) We have compiled extensions that are built against the Numpy C API. The Numpy transition guide for developers of downstream packages[^1] encourages us to put in this pin until we have wheels built against the newer version, which is not expected to be fully ABI compatible (but extensions built against Numpy 2 _should_ work with older Numpys). Note that this won't prevent package managers from resolving _older_ versions of Qiskit (which don't have the pin) along with Numpy 2, but there's not a vast amount we can do about that now. [^1]: https://github.com/numpy/numpy/issues/24300 --- releasenotes/notes/numpy-2-pin-f600328f24fab6dd.yaml | 10 ++++++++++ requirements.txt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/numpy-2-pin-f600328f24fab6dd.yaml diff --git a/releasenotes/notes/numpy-2-pin-f600328f24fab6dd.yaml b/releasenotes/notes/numpy-2-pin-f600328f24fab6dd.yaml new file mode 100644 index 0000000000..eb1d224b31 --- /dev/null +++ b/releasenotes/notes/numpy-2-pin-f600328f24fab6dd.yaml @@ -0,0 +1,10 @@ +--- +other: + - | + This version of Qiskit is explicitly pinned to the Numpy 1.x series, because it includes compiled + extensions that are not yet compiled against the as-yet-unreleased Numpy 2.x series. We will + release a new version of Qiskit with Numpy 2.x support as soon as feasible. + + We cannot prevent your package manager from resolving to older versions of Qiskit (which do not + have the same pin but are still likely to be incompatible) if you forcibly try to install Qiskit + alongside Numpy 2, before we have released a compatible version. diff --git a/requirements.txt b/requirements.txt index 4ad14f5083..d41eee50ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ rustworkx>=0.13.0 -numpy>=1.17 +numpy>=1.17,<2 ply>=3.10 psutil>=5 scipy>=1.5