-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support NumPy 2 #977
Support NumPy 2 #977
Conversation
VisibleDeprecationWarning has been Edit: Ahh, no, it's moved now, but it wasn't always there. I'll work on this in a couple of days. I think we have about at least a week before release. FYI, Python has a visible Deprecation warning. It's called FutureWarning: Base class for warnings about deprecated features when those warnings are intended for end users of applications that are written in Python. (Wording was updated in a PEP a few years ago to clarify it is intended to be a deprecation warning) |
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
9f44914
to
1a58905
Compare
Signed-off-by: Henry Schreiner <[email protected]>
ccdbd55
to
613086f
Compare
@@ -37,20 +37,14 @@ jobs: | |||
strategy: | |||
fail-fast: false | |||
matrix: | |||
os: [ubuntu-latest, windows-latest, macos-latest] | |||
arch: [auto, aarch64, universal2] | |||
os: [ubuntu-latest, windows-latest, macos-13, macos-14] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MacOS 14 is the new ARM runner. So this builds native wheels on both (the ARM part can now be tested! Except for CPython 3.8, which is wonky)
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
Successful wheel build: https://github.com/henryiii/iminuit/actions/runs/8520504460/job/23336798970 |
SciPy 1.13 has shipped! One step closer to NumPy 2.0 releasing. |
Ok, I shall use that in the future. |
Thank you for the extensive patch and the pointers. If feasible, I would prefer to install the right versions of dependencies via environment markers declared in pyproject.toml. This should be possible for the numpy version at least. scipy is an optional dependency, I don't know whether these can be declared with environment markers as well. If it is cannot be done easily, then installing the right scipy version in the CI workflow is ok. |
Thank you for the nice patch. |
👋 @HDembinski would it be possible to get a release of some sort (I'm not sure given the development that has happened since release $ docker run --rm -ti python:3.12 /bin/bash
root@f790da29487c:/# python -m venv venv && . venv/bin/activate
(venv) root@f790da29487c:/# python -m venv venv && . venv/bin/activate
(venv) root@f790da29487c:/# python -m pip --quiet install --upgrade pip wheel
(venv) root@f790da29487c:/# python -m pip install --upgrade iminuit
Collecting iminuit
Downloading iminuit-2.25.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Collecting numpy>=1.21 (from iminuit)
Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 926.1 kB/s eta 0:00:00
Downloading iminuit-2.25.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (423 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 423.9/423.9 kB 6.2 MB/s eta 0:00:00
Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.0/18.0 MB 42.7 MB/s eta 0:00:00
Installing collected packages: numpy, iminuit
Successfully installed iminuit-2.25.2 numpy-1.26.4
(venv) root@f790da29487c:/# python -m pip install --upgrade --pre numpy
Requirement already satisfied: numpy in /venv/lib/python3.12/site-packages (1.26.4)
Collecting numpy
Downloading numpy-2.0.0rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.9/60.9 kB 937.6 kB/s eta 0:00:00
Downloading numpy-2.0.0rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.0/19.0 MB 52.2 MB/s eta 0:00:00
Installing collected packages: numpy
Attempting uninstall: numpy
Found existing installation: numpy 1.26.4
Uninstalling numpy-1.26.4:
Successfully uninstalled numpy-1.26.4
Successfully installed numpy-2.0.0rc2
(venv) root@f790da29487c:/# python
Python 3.12.3 (main, Apr 24 2024, 11:17:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import iminuit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/venv/lib/python3.12/site-packages/iminuit/__init__.py", line 24, in <module>
from iminuit.minuit import Minuit
File "/venv/lib/python3.12/site-packages/iminuit/minuit.py", line 6, in <module>
from iminuit import util as mutil
File "/venv/lib/python3.12/site-packages/iminuit/util.py", line 11, in <module>
from iminuit import _repr_html, _repr_text, _deprecated
File "/venv/lib/python3.12/site-packages/iminuit/_deprecated.py", line 2, in <module>
from numpy import VisibleDeprecationWarning
ImportError: cannot import name 'VisibleDeprecationWarning' from 'numpy' (/venv/lib/python3.12/site-packages/numpy/__init__.py) I've started to see this in some environments where other dependencies are testing against the release candidates of NumPy, and it would be great if |
NumPy 2 will be released mid June. June 16 IIRC. I would highly recommend releasing an iminuit release supporting it before then! |
@henryiii @matthewfeickert Release is in progress. |
Fantastic, thanks! I think this means all our key libraries are now ready for NumPy 2. |
A new release of iMinuit needs to be made with pybind11 2.12 in order to support numpy 2. All binaries must be rebuilt with pybind11 2.12+ in order to support NumPy 2.
That should happen automatically, but I took the opportunity to update a few things while I was adding a NumPy 2 test. (which I actually forgot to do, will make draft until I add that!)