Bug 2359520

Summary: python-numexpr fails to build with Python 3.14: 8 errors: ValueError: operands could not be broadcast together with shapes (1000000,) (0,) 2 failures: AssertionError: sys.getrefcount(a) == 2
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-numexprAssignee: Jonathan Wright <jonathan>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: epel-packagers-sig, jonathan, ksurma, mhroncok, python-packagers-sig, thibault, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-05-29 17:31:50 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: 2322407    

Description Karolina Surma 2025-04-14 14:31:52 UTC
python-numexpr fails to build with Python 3.14.0a7.

ERROR: test_rational_expr (numexpr.tests.test_numexpr.test_numexpr.test_rational_expr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.14/site-packages/numpy/testing/_private/utils.py", line 851, in assert_array_compare
    val = comparison(x, y)
  File "/usr/lib64/python3.14/site-packages/numpy/testing/_private/utils.py", line 1165, in compare
    z = abs(x - y)
            ~~^~~
ValueError: operands could not be broadcast together with shapes (1000000,) (0,) 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/python-numexpr-2.10.2-build/numexpr-2.10.2/build/lib.linux-x86_64-cpython-314/numexpr/tests/test_numexpr.py", line 79, in test_rational_expr
    assert_array_almost_equal(x, y)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/site-packages/numpy/_utils/__init__.py", line 86, in wrapper
    return fun(*args, **kwargs)
  File "/usr/lib64/python3.14/site-packages/numpy/testing/_private/utils.py", line 1172, in assert_array_almost_equal
    assert_array_compare(compare, actual, desired, err_msg=err_msg,
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                         verbose=verbose,
                         ^^^^^^^^^^^^^^^^
             header=('Arrays are not almost equal to %d decimals' % decimal),
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             precision=decimal)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/site-packages/numpy/testing/_private/utils.py", line 929, in assert_array_compare
    raise ValueError(msg)
ValueError: 
error during assertion:

Traceback (most recent call last):
  File "/usr/lib64/python3.14/site-packages/numpy/testing/_private/utils.py", line 851, in assert_array_compare
    val = comparison(x, y)
  File "/usr/lib64/python3.14/site-packages/numpy/testing/_private/utils.py", line 1165, in compare
    z = abs(x - y)
            ~~^~~
ValueError: operands could not be broadcast together with shapes (1000000,) (0,) 

Arrays are not almost equal to 6 decimals
 ACTUAL: array([0.000000e+00, 4.225352e-01, 4.026846e-01, ..., 1.875002e-06,
       1.875000e-06, 1.874998e-06], shape=(1000000,))
 DESIRED: array([], dtype=float64)

======================================================================
FAIL: test_refcount (numexpr.tests.test_numexpr.test_numexpr2.test_refcount)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-numexpr-2.10.2-build/numexpr-2.10.2/build/lib.linux-x86_64-cpython-314/numexpr/tests/test_numexpr.py", line 317, in test_refcount
    assert sys.getrefcount(a) == 2
           ^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

----------------------------------------------------------------------

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08899418-python-numexpr/

For all our attempts to build python-numexpr with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-numexpr/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Miro Hrončok 2025-05-26 18:53:35 UTC
test_refcount is likely https://docs.python.org/3.14/whatsnew/3.14.html#whatsnew314-refcount

Comment 2 Zbigniew Jędrzejewski-Szmek 2025-05-29 17:31:50 UTC
The build passed in copr with the Karolina's pull request. Thanks.