python-contourpy fails to build with Python 3.13.0a2. The failure is: + /usr/bin/pytest -k 'not image' /var/tmp/rpm-tmp.qj4E8r: line 53: 742 Segmentation fault (core dumped) CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" PATH="/builddir/build/BUILDROOT/python-contourpy-1.2.0-2.fc40~bootstrap.x86_64/usr/bin:$PATH" PYTHONPATH="${PYTHONPATH:-/builddir/build/BUILDROOT/python-contourpy-1.2.0-2.fc40~bootstrap.x86_64/usr/lib64/python3.13/site-packages:/builddir/build/BUILDROOT/python-contourpy-1.2.0-2.fc40~bootstrap.x86_64/usr/lib/python3.13/site-packages}" PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} --ignore=/builddir/build/BUILD/contourpy-1.2.0/.pyproject-builddir" PYTEST_XDIST_AUTO_NUM_WORKERS=4 /usr/bin/pytest -k 'not image' When debugging the failure, I added: BuildRequires: python3-debug ... %check %{py3_test_envvars} python3-debug -c 'import contourpy' And I got: + python3-debug -c 'import contourpy' python3-debug: /builddir/build/BUILD/Python-3.13.0a2/Objects/dictobject.c:5473: _PyObject_InitInlineValues: Assertion `keys != NULL' failed. RPM build errors: /var/tmp/rpm-tmp.agBjMb: line 53: 564 Aborted (core dumped) CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" PATH="/builddir/build/BUILDROOT/python-contourpy-1.2.0-2.fc40~bootstrap.x86_64/usr/bin:$PATH" PYTHONPATH="${PYTHONPATH:-/builddir/build/BUILDROOT/python-contourpy-1.2.0-2.fc40~bootstrap.x86_64/usr/lib64/python3.13/site-packages:/builddir/build/BUILDROOT/python-contourpy-1.2.0-2.fc40~bootstrap.x86_64/usr/lib/python3.13/site-packages}" PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} --ignore=/builddir/build/BUILD/contourpy-1.2.0/.pyproject-builddir" PYTEST_XDIST_AUTO_NUM_WORKERS=8 python3-debug -c 'import contourpy' I suspect this is caused by a problem in pybind11. I wanted to report this upstream somewhere, but reproducing outside of RPM environment is currently very hard due to problems in meson (patch-fixed in Fedora). For all our attempts to build python-contourpy with Python 3.13, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-contourpy/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.13: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/ Let us know here if you have any questions. Python 3.13 is planned to be included in Fedora 41. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
I'm pretty sure this is going to be a pybind11 issue; I don't think contourpy has any Python API calls in it.
It's a bug in pybind11: the pybind11_static_property type is initialized (by PyType_Ready()) without Py_TPFLAGS_MANAGED_DICT, and *then* pybind11 sets the Py_TPFLAGS_MANAGED_DICT flag on the type. The flag should be set *before calling PyType_Ready(). Maybe it worked on Python 3.12, but in Python 3.13, it's now a bug. In pybind11/include/pybind11/detail/class.h, make_static_property_type() creates the heap type "pybind11_static_property", calls PyType_Ready(), and only later calls enable_dynamic_attributes() which sets Py_TPFLAGS_MANAGED_DICT flag.
I reported the issue upstream: https://github.com/pybind/pybind11/issues/4970
https://github.com/pybind/pybind11/pull/4971 https://src.fedoraproject.org/rpms/pybind11/pull-request/10
I'm moving this bugzilla to pybind11. It has been built in our copr with the patch, but I'd wait with merging before we hear from upstream (or at least to January).
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle. Changing version to 40.