[all] testtools and support for Python 3.10 (error du to deprecation of distutils)

Thomas Goirand zigo at debian.org
Mon Dec 13 16:24:23 UTC 2021


Hi,

When I try to build rally-openstack, I get this, in the test discovery:

/usr/lib/python3/dist-packages/rally/common/cfg.py:19: in <module>
    from oslo_config import fixture  # noqa
/usr/lib/python3/dist-packages/oslo_config/fixture.py:18: in <module>
    import fixtures
/usr/lib/python3/dist-packages/fixtures/__init__.py:81: in <module>
    from fixtures.fixture import (
/usr/lib/python3/dist-packages/fixtures/fixture.py:34: in <module>
    from fixtures.callmany import (
/usr/lib/python3/dist-packages/fixtures/callmany.py:31: in <module>
    MultipleExceptions = try_import(
/usr/lib/python3/dist-packages/testtools/helpers.py:30: in try_import
    __import__(module_name)
/usr/lib/python3/dist-packages/testtools/__init__.py:99: in <module>
    from testtools.distutilscmd import TestCommand
/usr/lib/python3/dist-packages/testtools/distutilscmd.py:7: in <module>
    from distutils.core import Command
/usr/lib/python3.10/distutils/__init__.py:19: in <module>
    warnings.warn(_DEPRECATION_MESSAGE,
E   DeprecationWarning: The distutils package is deprecated and slated
for removal in Python 3.12. Use setuptools or check PEP 632 for
potential alternatives

This warning makes it impossible to discover rally-openstack tests,
because of the imports here:

https://github.com/testing-cabal/testtools/blob/master/testtools/distutilscmd.py#L7

Can someone work on removing distutils support from Testtools? Or is
there a way to trick pytest to not fail? Help would be greatly
appreciated here.

Cheers,

Thomas Goirand (zigo)



More information about the openstack-discuss mailing list