Bug 2245871 - python-random2 fails to build with Python 3.13: AttributeError: module 'unittest' has no attribute 'makeSuite'
Summary: python-random2 fails to build with Python 3.13: AttributeError: module 'unitt...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-random2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Basto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-24 12:04 UTC by Karolina Surma
Modified: 2023-11-23 17:17 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-11-23 17:17:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-24 12:04:31 UTC
python-random2 fails to build with Python 3.13.0a1.

+ /usr/bin/python3 -m tox --current-env -q --recreate -e py313
running test

Traceback (most recent call last):
  File "/builddir/build/BUILD/random2-1.0.1/setup.py", line 3, in <module>
    setup (
  File "/usr/lib/python3.13/site-packages/setuptools/__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.13/site-packages/setuptools/dist.py", line 989, in run_command
    super().run_command(command)
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.13/site-packages/setuptools/command/test.py", line 223, in run
    self.run_tests()
  File "/usr/lib/python3.13/site-packages/setuptools/command/test.py", line 226, in run_tests
    test = unittest.main(
           ^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/main.py", line 103, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python3.13/unittest/main.py", line 142, in parseArgs
    self.createTests()
  File "/usr/lib64/python3.13/unittest/main.py", line 153, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/loader.py", line 207, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/loader.py", line 192, in loadTestsFromName
    test = obj()
           ^^^^^
  File "/builddir/build/BUILD/random2-1.0.1/src/tests.py", line 593, in test_suite
    unittest.makeSuite(WichmannHill_TestBasicOps),
    ^^^^^^^^^^^^^^^^^^
  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 'makeSuite'
py313: exit 1 (0.21 seconds) /builddir/build/BUILD/random2-1.0.1> python setup.py test -q pid=199
  py313: FAIL code 1 (0.22 seconds)

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/06557755-python-random2/

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

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 Karolina Surma 2023-11-23 15:36:27 UTC
Hi, as I determined this package blocked more other packages, I took a look at the error and proposed a downstream fix: https://src.fedoraproject.org/rpms/python-random2/pull-request/3


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