Bug 2247006

Summary: python-ptyprocess fails to build with Python 3.13: AttributeError: module 'unittest' has no attribute 'makeSuite'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-ptyprocessAssignee: Orion Poplawski <orion>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 40CC: igor.raits, ksurma, mhroncok, orion, python-packagers-sig, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-09-27 13:01:26 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-10-30 11:43:04 UTC
python-ptyprocess fails to build with Python 3.13.0a1.

+ /usr/bin/python3 -m pytest -v
============================= test session starts ==============================
platform linux -- Python 3.13.0a1, pytest-7.4.2, pluggy-1.3.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /builddir/build/BUILD/ptyprocess-0.7.0
collecting ... collected 13 items / 1 error

==================================== ERRORS ====================================
________________ ERROR collecting tests/test_invalid_binary.py _________________
/usr/lib/python3.13/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.13/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.13/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/usr/lib/python3.13/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.13/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/usr/lib/python3.13/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/usr/lib/python3.13/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.13/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1381: in _gcd_import
    ???
<frozen importlib._bootstrap>:1354: in _find_and_load
    ???
<frozen importlib._bootstrap>:1325: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:929: in _load_unlocked
    ???
/usr/lib/python3.13/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
tests/test_invalid_binary.py:73: in <module>
    suite = unittest.makeSuite(InvalidBinaryChars,'test')
/usr/lib64/python3.13/unittest/__init__.py:80: in __getattr__
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
E   AttributeError: module 'unittest' has no attribute 'makeSuite'
=========================== short test summary info ============================
ERROR tests/test_invalid_binary.py - AttributeError: module 'unittest' has no...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!

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/06573427-python-ptyprocess/

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

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:02:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.