Bug 2265478 - python-nibabel fails to build with Python 3.13: AttributeError: module 'logging' has no attribute 'warn'; indentation in docstrings mismatch, AssertionError
Summary: python-nibabel fails to build with Python 3.13: AttributeError: module 'loggi...
Keywords:
Status: CLOSED RAWHIDE
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-22 09:26 UTC by Karolina Surma
Modified: 2024-02-25 21:35 UTC (History)
5 users (show)

Fixed In Version: python-nibabel-5.2.0-2.fc41
Clone Of:
Environment:
Last Closed: 2024-02-25 21:35:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nipy nibabel issues 1295 0 None open python-nibabel fails to build with Python 3.13: AttributeError: module 'logging' has no attribute 'warn'; indentation in... 2024-02-22 10:11:49 UTC

Description Karolina Surma 2024-02-22 09:26:15 UTC
python-nibabel fails to build with Python 3.13.0a4.

FAILED nibabel/tests/test_deprecated.py::TestNibabelDeprecator::test_dep_func
FAILED nibabel/tests/test_deprecator.py::TestDeprecatorFunc::test_dep_func - ...
FAILED nibabel/tests/test_parrec.py::test_diffusion_parameters_strict_sort - ...
FAILED nisext/tests/test_sexts.py::test_package_check - AttributeError: modul...


1) AttributeError: module 'logging' has no attribute 'warn'
According to https://docs.python.org/3.13/whatsnew/3.13.html:

logging: Remove undocumented and untested Logger.warn() and LoggerAdapter.warn() methods and logging.warn() function.
Deprecated since Python 3.3, they were aliases to the logging.Logger.warning() method,
logging.LoggerAdapter.warning() method and logging.warning() function.
(Contributed by Victor Stinner in gh-105376.)

2)
>       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

Indentation in docstrings is now stripped, the output needs to be adjusted.

3) 
>       assert_almost_equal(bvecs, DTI_PAR_BVECS[np.ix_(np.argsort(DTI_PAR_BVALS), [2, 0, 1])])

nibabel/tests/test_parrec.py:536: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
/usr/lib64/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7fd7ce47e8e0>, array([[ 0.   ,  0.   ,  0.   ],
       [-0...., -0.707, -0.   ],
       [ 0.   , -0.707,  0.707],
       [ 0.707, -0.   ,  0.707],
       [ 0.   ,  0.   ,  0.   ]]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 7 decimals
E           
E           Mismatched elements: 6 / 24 (25%)
E           Max absolute difference: 1.334
E           Max relative difference: 2.
E            x: array([[ 0.   ,  0.   ,  0.   ],
E                  [-0.333, -0.667, -0.667],
E                  [-0.667, -0.333,  0.667],...
E            y: array([[ 0.   ,  0.   ,  0.   ],
E                  [-0.333, -0.667, -0.667],
E                  [ 0.667, -0.667,  0.333],...

/usr/lib64/python3.13/contextlib.py:85: AssertionError


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/07046875-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 Ankur Sinha (FranciscoD) 2024-02-22 10:11:49 UTC
Reported upstream to start with: https://github.com/nipy/nibabel/issues/1295


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