Bug 2271065

Summary: python-lazy-loader fails to build with Python 3.13: RecursionError: maximum recursion depth exceeded
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-lazy-loaderAssignee: Ben Beasley <code>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, ksurma, mhroncok, neuro-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-04 08:37:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2244836    

Description Karolina Surma 2024-03-22 13:57:17 UTC
python-lazy-loader fails to build with Python 3.13.0a5.
============================= test session starts ==============================
platform linux -- Python 3.13.0a5, pytest-7.4.3, pluggy-1.3.0
rootdir: /builddir/build/BUILD/lazy_loader-0.3
collected 9 items

lazy_loader/tests/test_lazy_loader.py ...F.....                          [100%]

=================================== FAILURES ===================================
_________________________ test_lazy_import_nonbuiltins _________________________

    def test_lazy_import_nonbuiltins():
        np = lazy.load("numpy")
        sp = lazy.load("scipy")
        if not isinstance(np, lazy.DelayedImportErrorModule):
            assert np.sin(np.pi) == pytest.approx(0, 1e-6)
>       if isinstance(sp, lazy.DelayedImportErrorModule):

lazy_loader/tests/test_lazy_loader.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<frozen importlib.util>:209: in __getattribute__
    ???
<frozen importlib._bootstrap_external>:1015: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
/usr/lib64/python3.13/site-packages/scipy/__init__.py:121: in <module>
    from . import _distributor_init
<frozen importlib._bootstrap>:1412: in _handle_fromlist
    ???
<frozen importlib.util>:209: in __getattribute__
    ???
/usr/lib64/python3.13/site-packages/scipy/__init__.py:121: in <module>
    from . import _distributor_init
<frozen importlib._bootstrap>:1412: in _handle_fromlist
    ???
E   RecursionError: maximum recursion depth exceeded
!!! Recursion detected (same locals & position)
=========================== short test summary info ============================
FAILED lazy_loader/tests/test_lazy_loader.py::test_lazy_import_nonbuiltins - ...
========================= 1 failed, 8 passed in 0.94s ==========================

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07197811-python-lazy-loader/

For all our attempts to build python-lazy-loader with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-lazy-loader/

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.

Comment 1 Miro HronĨok 2024-04-04 08:37:28 UTC
Fixed via https://github.com/python/cpython/issues/117178