[all] testtools and support for Python 3.10 (error du to deprecation of distutils)
Jeremy Stanley
fungi at yuggoth.org
Mon Dec 13 21:14:10 UTC 2021
On 2021-12-13 22:08:48 +0100 (+0100), Thomas Goirand wrote:
> On 12/13/21 8:44 PM, Andrey Kurilin wrote:
> > Hi folks!
> >
> > пн, 13 дек. 2021 г. в 18:53, Jeremy Stanley <fungi at yuggoth.org
> > <mailto:fungi at yuggoth.org>>:
> >
> > On 2021-12-13 17:24:23 +0100 (+0100), Thomas Goirand wrote:
> > > When I try to build rally-openstack, I get this, in the test
> > discovery:
> > [...]
> > > /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
> > [...]
> > > 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.
> >
> > PYTHONWARNINGS must be getting set to "error" somewhere. Are you
> > setting it at invocation maybe?
> >
> >
> > It is set via tox.ini at
> > https://github.com/openstack/rally-openstack/blob/2.2.0/tox.ini#L122-L124 <https://github.com/openstack/rally-openstack/blob/2.2.0/tox.ini#L122-L124>
> >
> > It is better to fix deprecated things earlier before they result in the
> > broken project :)
[...]
> Again, this happens during the *test discovery*. I'm not using Tox
> (package maintainer never do). FYI, I'm simply doing:
>
> python3 -m pytest tests/unit
>
> If you know how to disable the errors on warning during test discovery,
> let me know. But right now, this equals to FTBFS for rally-openstack in
> Debian (the package was removed from testing because of it...).
To reiterate, PYTHONWARNINGS must be getting set to "error"
somewhere. Maybe it's exported in that environment before python3 is
invoked?
--
Jeremy Stanley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20211213/4aa41eb6/attachment.sig>
More information about the openstack-discuss
mailing list