Bug 2189396 - pybind11 fails to build with Python 3.12 Failed: DID NOT RAISE <class 'RuntimeError'>
Summary: pybind11 fails to build with Python 3.12 Failed: DID NOT RAISE <class 'Runtim...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pybind11
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Susi Lehtola
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12 2211813
TreeView+ depends on / blocked
 
Reported: 2023-04-25 05:54 UTC by Tomáš Hrnčiar
Modified: 2024-09-04 10:31 UTC (History)
6 users (show)

Fixed In Version: pybind11-2.11.1-1.fc39
Clone Of:
Environment:
Last Closed: 2024-09-04 10:31:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pybind/pybind11/commit/442261da585536521ff459b1457b2904895f23b4 0 None None None 2023-04-25 09:35:04 UTC
Github pybind/pybind11/commit/654fe92652e6dc0eec80b1877b531aaab3a3e56c 0 None None None 2023-04-25 05:54:04 UTC

Description Tomáš Hrnčiar 2023-04-25 05:54:04 UTC
pybind11 fails to build with Python 3.12.0a7.

=================================== FAILURES ===================================
___________________ test_flaky_exception_failure_point_init ____________________

    @pytest.mark.skipif("env.PYPY", reason="PyErr_NormalizeException Segmentation fault")
    def test_flaky_exception_failure_point_init():
>       with pytest.raises(RuntimeError) as excinfo:
E       Failed: DID NOT RAISE <class 'RuntimeError'>

excinfo    = <ExceptionInfo for raises contextmanager>

../../tests/test_exceptions.py:323: Failed
________________________________ test_importing ________________________________

    def test_importing():
        from collections import OrderedDict
    
        from pybind11_tests.modules import OD
    
        assert OD is OrderedDict
>       assert str(OD([(1, "a"), (2, "b")])) == "OrderedDict([(1, 'a'), (2, 'b')])"
E       assert "OrderedDict(...'a', 2: 'b'})" == "OrderedDict(...), (2, 'b')])"
E         - OrderedDict([(1, 'a'), (2, 'b')])
E         ?             ^^ ^    -  - ^     --
E         + OrderedDict({1: 'a', 2: 'b'})
E         ?             ^ ^       ^    +

OD         = <class 'collections.OrderedDict'>
OrderedDict = <class 'collections.OrderedDict'>

../../tests/test_modules.py:64: AssertionError
=========================== short test summary info ============================
SKIPPED [1] ../../tests/test_callbacks.py:203: Current PYBIND11_INTERNALS_VERSION too low
SKIPPED [1] ../../tests/test_stl.py:143: no <experimental/optional>
SKIPPED [1] ../../tests/test_stl.py:175: no <boost/optional>
FAILED ../../tests/test_exceptions.py::test_flaky_exception_failure_point_init
FAILED ../../tests/test_modules.py::test_importing - assert "OrderedDict(...'...
================== 2 failed, 788 passed, 3 skipped in 20.71s ===================

There is this upstream commit I've tried to backport, but the failure remains the same. https://github.com/pybind/pybind11/commit/654fe92652e6dc0eec80b1877b531aaab3a3e56c

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05846339-pybind11/

For all our attempts to build pybind11 with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/pybind11/

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.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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.

Comment 1 Tomáš Hrnčiar 2023-04-25 09:35:05 UTC
This commit fixes the latter test failure.

https://github.com/pybind/pybind11/commit/442261da585536521ff459b1457b2904895f23b4

Comment 2 Fedora Release Engineering 2023-08-16 07:13:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


Note You need to log in before you can comment on or make changes to this bug.