Bug 2280004 - numpy fails to build with Python 3.13: test_iter_refcount: AssertionError: assert_(sys.getrefcount(dt) > rc2_dt)
Summary: numpy fails to build with Python 3.13: test_iter_refcount: AssertionError: as...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: numpy
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-05-10 13:45 UTC by Karolina Surma
Modified: 2024-05-14 07:44 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-05-14 07:44:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-05-10 13:45:30 UTC
numpy fails to build with Python 3.13.0b1.

=================================== FAILURES ===================================
______________________________ test_iter_refcount ______________________________

    @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
    def test_iter_refcount():
        # Make sure the iterator doesn't leak
    
        # Basic
        a = arange(6)
        dt = np.dtype('f4').newbyteorder()
        rc_a = sys.getrefcount(a)
        rc_dt = sys.getrefcount(dt)
        with nditer(a, [],
                    [['readwrite', 'updateifcopy']],
                    casting='unsafe',
                    op_dtypes=[dt]) as it:
            assert_(not it.iterationneedsapi)
            assert_(sys.getrefcount(a) > rc_a)
            assert_(sys.getrefcount(dt) > rc_dt)
        # del 'it'
        it = None
        assert_equal(sys.getrefcount(a), rc_a)
        assert_equal(sys.getrefcount(dt), rc_dt)
    
        # With a copy
        a = arange(6, dtype='f4')
        dt = np.dtype('f4')
        rc_a = sys.getrefcount(a)
        rc_dt = sys.getrefcount(dt)
        it = nditer(a, [],
                    [['readwrite']],
                    op_dtypes=[dt])
        rc2_a = sys.getrefcount(a)
        rc2_dt = sys.getrefcount(dt)
        it2 = it.copy()
        assert_(sys.getrefcount(a) > rc2_a)
>       assert_(sys.getrefcount(dt) > rc2_dt)
E       AssertionError

a          = array([0., 1., 2., 3., 4., 5.], dtype=float32)
dt         = dtype('float32')
it         = <numpy.nditer object at 0x7fb500c6f550>
it2        = <numpy.nditer object at 0x7fb500c6f5f0>
rc2_a      = 3
rc2_dt     = 4294967295
rc_a       = 2
rc_dt      = 4294967295

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/07434550-numpy/

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

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.


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