pyserial fails to build with Python 3.13.0a1. + /usr/bin/python3 test/run_all_tests.py Patching sys.path to test local version. Testing Version: 3.5 Traceback (most recent call last): File "/builddir/build/BUILD/pyserial-3.5/test/run_all_tests.py", line 40, in <module> testsuite = unittest.findTestCases(module) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.13/unittest/__init__.py", line 80, in __getattr__ raise AttributeError(f"module {__name__!r} has no attribute {name!r}") AttributeError: module 'unittest' has no attribute 'findTestCases' 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/06546828-pyserial/ For all our attempts to build pyserial with Python 3.13, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/pyserial/ 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.
I managed to build the package by adding this bit to the specfile: +sed -i 's/unittest.findTestCases(module)/unittest.TestLoader().loadTestsFromModule(modulename)/' test/run_all_tests.py
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle. Changing version to 40.
Upstream issue: https://github.com/pyserial/pyserial/issues/754 Downstream patch with a sed expression: https://src.fedoraproject.org/rpms/pyserial/pull-request/6