Bug 2137292

Summary: python-pint fails to build with numpy 1.23
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-pintAssignee: Matthias Runge <mrunge>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: code, cstratak, gwync, jspaleta, lzachar, mrunge, orion, python-packagers-sig, rdieter, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pint-0.16.1-11.fc39 python-pint-0.19.2-6.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-21 18:19:53 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: 2117176, 2135404, 2168842, 2220407, 2231791    

Description Miro Hrončok 2022-10-24 11:11:34 UTC
Description of problem:
When updating numpy to 1.23.4, I realized python-pint fails to build with it.

https://copr.fedorainfracloud.org/coprs/churchyard/numpy-1.23/package/python-pint/

=================================== FAILURES ===================================
__________________ TestNumpyUnclassified.test_alen_numpy_func __________________

self = <pint.testsuite.test_numpy.TestNumpyUnclassified testMethod=test_alen_numpy_func>

    @helpers.requires_array_function_protocol()
    def test_alen_numpy_func(self):
>       self.assertEqual(np.alen(self.q), 2)

pint/testsuite/test_numpy.py:921: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

attr = 'alen'

    def __getattr__(attr):
        # Warn for expired attributes, and return a dummy function
        # that always raises an exception.
        try:
            msg = __expired_functions__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)

            def _expired(*args, **kwds):
                raise RuntimeError(msg)

            return _expired

        # Emit warnings for deprecated attributes
        try:
            val, msg = __deprecated_attrs__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
            return val

        # Importing Tester requires importing all of UnitTest which is not a
        # cheap import Since it is mainly used in test suits, we lazy import it
        # here to save on the order of 10 ms of import time for most users
        #
        # The previous way Tester was imported also had a side effect of adding
        # the full `numpy.testing` namespace
        if attr == 'testing':
            import numpy.testing as testing
            return testing
        elif attr == 'Tester':
            from .testing import Tester
            return Tester

>       raise AttributeError("module {!r} has no attribute "
                             "{!r}".format(__name__, attr))
E       AttributeError: module 'numpy' has no attribute 'alen'

/usr/lib64/python3.11/site-packages/numpy/__init__.py:311: AttributeError


Version-Release number of selected component: 0.16.1-8 


How reproducible:
Fetch numpy from his PR:
https://src.fedoraproject.org/rpms/numpy/pull-request/27
Or use this Copr:
https://copr.fedorainfracloud.org/coprs/churchyard/numpy-1.23/
And build this package.

Actual results: Package fails to build.


Expected results: Package builds successfully.


Let me know if we should delay the update or proceed.

Comment 1 Miro Hrončok 2022-11-08 14:47:01 UTC
No response, so I'm proceeding with the numpy update.

Comment 2 Ben Cotton 2023-02-07 14:57:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 4 Fedora Update System 2023-10-30 17:36:37 UTC
FEDORA-2023-1f53a56b85 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-1f53a56b85

Comment 5 Fedora Update System 2023-10-30 17:55:11 UTC
FEDORA-2023-1f53a56b85 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.