edgewall / genshi

Python toolkit for generation of output for the web
http://genshi.edgewall.org
Other
86 stars 35 forks source link

Python 3.13.0b1: `AttributeError: module 'unittest' has no attribute 'makeSuite'` #72

Closed mgorny closed 3 months ago

mgorny commented 4 months ago
$ python3.13 setup.py test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
/usr/lib/python3.13/site-packages/setuptools/command/test.py:193: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  ir_d = dist.fetch_build_eggs(dist.install_requires)
/usr/lib/python3.13/site-packages/setuptools/command/test.py:194: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  tr_d = dist.fetch_build_eggs(dist.tests_require or [])
/usr/lib/python3.13/site-packages/setuptools/command/test.py:195: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  er_d = dist.fetch_build_eggs(
running egg_info
creating Genshi.egg-info
writing Genshi.egg-info/PKG-INFO
writing dependency_links to Genshi.egg-info/dependency_links.txt
writing entry points to Genshi.egg-info/entry_points.txt
writing requirements to Genshi.egg-info/requires.txt
writing top-level names to Genshi.egg-info/top_level.txt
writing manifest file 'Genshi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.html' under directory 'doc'
warning: no files found matching '*.css' under directory 'doc'
warning: no files found matching '*.py' under directory 'doc'
warning: no files found matching '*.ini' under directory 'doc'
warning: no files found matching 'COPYING' under directory 'doc'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
adding license file 'COPYING'
writing manifest file 'Genshi.egg-info/SOURCES.txt'
running build_ext
building 'genshi._speedups' extension
creating build
creating build/temp.linux-x86_64-cpython-313
creating build/temp.linux-x86_64-cpython-313/genshi
x86_64-pc-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -fPIC -I/usr/include/python3.13 -c genshi/_speedups.c -o build/temp.linux-x86_64-cpython-313/genshi/_speedups.o
x86_64-pc-linux-gnu-gcc -shared build/temp.linux-x86_64-cpython-313/genshi/_speedups.o -L/usr/lib64 -o /tmp/genshi/genshi/_speedups.cpython-313-x86_64-linux-gnu.so
/tmp/genshi/genshi/filters/html.py:357: SyntaxWarning: invalid escape sequence '\('
  u'[Uu][Rr\u0280][Ll\u029F]%s*\(([^)]+)' % (r'\s')).finditer
Traceback (most recent call last):
  File "/tmp/genshi/setup.py", line 98, in <module>
    setup(
    ~~~~~^
        test_suite = 'genshi.tests.suite',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        **extra
        ^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/setuptools/__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 184, in setup
    return run_commands(dist)
  File "/usr/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 200, 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 967, 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(
        None,
    ...<4 lines>...
        exit=False,
    )
  File "/usr/lib/python3.13/unittest/main.py", line 103, in __init__
    self.parseArgs(argv)
    ~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/unittest/main.py", line 142, in parseArgs
    self.createTests()
    ~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/unittest/main.py", line 153, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames,
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
                                                   self.module)
                                                   ^^^^^^^^^^^^
  File "/usr/lib/python3.13/unittest/loader.py", line 207, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
              ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/unittest/loader.py", line 192, in loadTestsFromName
    test = obj()
  File "/tmp/genshi/genshi/tests/__init__.py", line 23, in suite
    suite.addTest(builder.suite())
                  ~~~~~~~~~~~~~^^
  File "/tmp/genshi/genshi/tests/builder.py", line 70, in suite
    suite.addTest(unittest.makeSuite(ElementFactoryTestCase, 'test'))
                  ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/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'
FelixSchwarz commented 3 months ago

This can be fixed by Fedora's patch: https://src.fedoraproject.org/rpms/python-genshi/blob/rawhide/f/python-genshi-use-default-test-loader.patch

hodgestar commented 3 months ago

Thanks @FelixSchwarz. Patch has not been applied to master and will be included in the next release.