Update minimum pybind11 to 2.13.2#29021
Conversation
|
I think the matplotlib 3.9.2 cp313t wheels (or at least the manylinux x86_64 one) were built using the problematic pybind11 2.13.1. If I create a new 3.13.0t virtual environment using pyenv and install the latest contourpy (1.3.0) and matplotlib (3.9.2) wheels and run some code that uses both matplotlib and contourpy: $ PYTHON_GIL=0 python
Python 3.13.0 experimental free-threading build (main, Oct 26 2024, 16:31:15) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> plt.contour([[1,2],[3,4]], levels=5)
Floating point exception (core dumped)If I then install the latest matplotlib nightly wheel (3.10.0.dev900+g835d5125a3) which definitely uses a later pybind11 the above code works fine and I can But maybe the fact that the matplotlib 3.9.2 cp313t wheels are problematic is moot. We aren't fully claiming free-threaded support until there is a matplotlib release containing PR #28819 and a kiwisolver release with the equivalent (nucleic/kiwi#186). Until then if you try to import matplotlib in a free-threaded venv you get the warning that matplotlib/kiwisolver aren't claiming they can run safely without the GIL and you have to, at your own risk, use So given that matplotlib 3.10 is imminent and includes #28819 (and hopefully this PR) then I think we are OK to point users towards that release if they want free-threaded support. We can't really do a 3.9.3 release including #28819 as that would also need all of the recent pybind11 PRs which is not appropriate for a patch release. |
Update minimum pybind11 to 2.13.2 as use of 2.13.1 can cause mutex problems in Python 3.13 free-threaded builds, see pybind/pybind11#5420.
It would be good to confirm exactly which version of pybind11 was used to build the matplotlib 3.9.2 cp313t wheels on PyPI. They are dated Aug 13, the same date that pybind11 2.13.2 and 2.13.3 were released. So the mpl wheels could potentially have used 2.13.1 which would be bad. The GHA run that built and uploaded the wheel is https://github.com/matplotlib/matplotlib/actions/runs/10361240538/job/28683177700 but it is not verbose enough to including the pybind11 version used.