Bug 2266593 - python-nibabel fails to build with Python 3.13: Docstring indentation is now stripped by compiler
Summary: python-nibabel fails to build with Python 3.13: Docstring indentation is now ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-nibabel
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ankur Sinha (FranciscoD)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-02-28 12:42 UTC by Karolina Surma
Modified: 2024-04-02 17:18 UTC (History)
6 users (show)

Fixed In Version: python-nibabel-5.2.1-2.fc41
Clone Of:
Environment:
Last Closed: 2024-04-02 17:18:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nipy nibabel issues 1311 0 None open Two tests are failing in 5.2.1 with Python 3.13.0a5 2024-03-28 13:25:41 UTC

Description Karolina Surma 2024-02-28 12:42:44 UTC
python-nibabel fails to build with Python 3.13.0a4.

=================================== FAILURES ===================================
_____________________ TestNibabelDeprecator.test_dep_func ______________________

self = <nibabel.tests.test_deprecated.TestNibabelDeprecator object at 0x7ff50f2b64b0>

    def test_dep_func(self):
        # Test function deprecation
        dec = self.dep_func
        func = dec('foo')(func_no_doc)
        with pytest.deprecated_call():
            assert func() is None
        assert func.__doc__ == 'foo\n'
        func = dec('foo')(func_doc)
        with pytest.deprecated_call() as w:
            assert func(1) is None
            assert len(w) == 1
        assert func.__doc__ == 'A docstring\n\nfoo\n'
        func = dec('foo')(func_doc_long)
        with pytest.deprecated_call() as w:
            assert func(1, 2) is None
            assert len(w) == 1
>       assert (
            func.__doc__
            == f'A docstring\n   \n   foo\n   \n{indent(TESTSETUP, "   ", lambda x: True)}'
            f'   Some text\n{indent(TESTCLEANUP, "   ", lambda x: True)}'
        )
E       AssertionError: assert 'A docstring\...ne, None)\n\n' == 'A docstring\... None)\n   \n'
E           A docstring
E         -    
E         -    foo
E         -    
E         -    
E         -    
E         + ...
E         
E         ...Full output truncated (43 lines hidden), use '-vv' to show

nibabel/tests/test_deprecator.py:95: AssertionError
_______________________ TestDeprecatorFunc.test_dep_func _______________________

self = <nibabel.tests.test_deprecator.TestDeprecatorFunc object at 0x7ff50f229f40>

    def test_dep_func(self):
        # Test function deprecation
        dec = self.dep_func
        func = dec('foo')(func_no_doc)
        with pytest.deprecated_call():
            assert func() is None
        assert func.__doc__ == 'foo\n'
        func = dec('foo')(func_doc)
        with pytest.deprecated_call() as w:
            assert func(1) is None
            assert len(w) == 1
        assert func.__doc__ == 'A docstring\n\nfoo\n'
        func = dec('foo')(func_doc_long)
        with pytest.deprecated_call() as w:
            assert func(1, 2) is None
            assert len(w) == 1
>       assert (
            func.__doc__
            == f'A docstring\n   \n   foo\n   \n{indent(TESTSETUP, "   ", lambda x: True)}'
            f'   Some text\n{indent(TESTCLEANUP, "   ", lambda x: True)}'
        )
E       AssertionError: assert 'A docstring\...ne, None)\n\n' == 'A docstring\... None)\n   \n'
E           A docstring
E         -    
E         -    foo
E         -    
E         -    
E         -    
E         + ...
E         
E         ...Full output truncated (43 lines hidden), use '-vv' to show


According to https://docs.python.org/3.13/whatsnew/3.13.html:
docstring indentation is now stripped by compiler.

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

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

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 Sandro 2024-03-28 13:25:41 UTC
Reported upstream.

Comment 2 Fedora Update System 2024-04-02 17:14:30 UTC
FEDORA-2024-e31b4cfbdd (python-nibabel-5.2.1-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-e31b4cfbdd

Comment 3 Fedora Update System 2024-04-02 17:18:22 UTC
FEDORA-2024-e31b4cfbdd (python-nibabel-5.2.1-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


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