Bug 2250671

Summary: python-numexpr fails to build with Python 3.13: AttributeError: module 'unittest' has no attribute makeSuite
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: urgent Docs Contact:
Priority: urgent    
Version: 40CC: epel-packagers-sig, jonathan, ksurma, mhroncok, python-packagers-sig, thibault, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-numexpr-2.8.5-6.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-10 10:26:47 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: 2244836    

Description Karolina Surma 2023-11-20 13:49:17 UTC
python-numexpr fails to build with Python 3.13.0a1.

AttributeError: module 'unittest' has no attribute 'makeSuite'
According to https://docs.python.org/3.13/whatsnew/3.13.html:

Removed the following unittest functions, deprecated in Python 3.11:
- unittest.findTestCases()
- unittest.makeSuite()
- unittest.getTestCaseNames()


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/06660890-python-numexpr/

For all our attempts to build python-numexpr with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/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.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 Aoife Moloney 2024-02-15 23:05:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 2 Karolina Surma 2024-05-30 11:16:43 UTC
Upstream issue: https://github.com/pydata/numexpr/issues/486
Downstream workaround: https://src.fedoraproject.org/rpms/python-numexpr/pull-request/2

Comment 3 Karolina Surma 2024-05-30 11:19:34 UTC
When mitigated, this happens multiple times with beta1:

======================================================================
ERROR: test_multithread (numexpr.tests.test_numexpr.test_threading.test_multithread)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-numexpr-2.8.5-build/numexpr-2.8.5/build/lib.linux-x86_64-cpython-313/numexpr/tests/test_numexpr.py", line 1072, in test_multithread
    work(10)  # warm compilation cache
    ~~~~^^^^
  File "/builddir/build/BUILD/python-numexpr-2.8.5-build/numexpr-2.8.5/build/lib.linux-x86_64-cpython-313/numexpr/tests/test_numexpr.py", line 1070, in work
    evaluate('a+a')
    ~~~~~~~~^^^^^^^
  File "/builddir/build/BUILD/python-numexpr-2.8.5-build/numexpr-2.8.5/build/lib.linux-x86_64-cpython-313/numexpr/necompiler.py", line 818, in evaluate
    arguments = getArguments(names, local_dict, global_dict)
  File "/builddir/build/BUILD/python-numexpr-2.8.5-build/numexpr-2.8.5/build/lib.linux-x86_64-cpython-313/numexpr/necompiler.py", line 751, in getArguments
    local_dict.clear()
    ^^^^^^^^^^^^^^^^
AttributeError: 'FrameLocalsProxy' object has no attribute 'clear'

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

Comment 4 Karolina Surma 2024-05-30 11:29:19 UTC
This blocks over 80 packages in the upcoming Python mass rebuild.

Comment 5 Miro Hrončok 2024-05-30 15:10:02 UTC
I have updated https://src.fedoraproject.org/rpms/python-numexpr/pull-request/2

Comment 6 Zbigniew Jędrzejewski-Szmek 2024-06-10 10:26:47 UTC
Thank you.