-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
MAINT: Escalate import warning to an import error #26149
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
Conversation
3fb6d78
to
3094cad
Compare
Now that pybind11 has the 2.12 release we can escalate the warning to an error here.
This is the before-and-after for me in this branch, importing the latest version of matplotlib (using PYTHONPATH to point to the dev numpy) before
after
It seems the only difference is that the more helpful I don't really understand what is going on in that error message. Is something manually printing the first traceback before the real traceback? In IPython, the first traceback is formatted like a normal traceback with no coloring, then the ImportError is formatted like an IPython traceback. |
Of course not: matplotlib doesn't use an old pybind11 here which is what this is about. So you can have the old message cryptically pointing to the ABI versions which is a bit nicer, but then you do not have any protection for old
Clearly, the code diff explains this and why. We can remove the first traceback print but obviously not the error print (hoping that nothing swallows the traceback as pytest seems to do). |
FWIW, what is surprising to me is that the error gets replaced with an |
This should be backported? |
Thanks Sebastian. |
Yes, that was the plan. |
Now that pybind11 has the 2.12 release we can escalate the warning to an error here.
It may make sense (and also be necessary for CI to succeed) to hold off slightly so that most downstream wheels picked up the new pybind11 release.
@ksunden in case you were not aware, pybind11 has the new release now, so we should be good to go (and matplotlib having rebuild with it may be a good "indicator" that we can put this in).
Closes gh-26010