Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2137292 - python-pint fails to build with numpy 1.23
Summary: python-pint fails to build with numpy 1.23
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pint
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matthias Runge
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F38FTBFS F39FTBFS F40FTBFS PYTHON3.12 2220407
TreeView+ depends on / blocked
 
Reported: 2022-10-24 11:11 UTC by Miro Hrončok
Modified: 2023-10-30 17:55 UTC (History)
10 users (show)

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:
Clone Of:
Environment:
Last Closed: 2023-08-21 18:19:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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