diff --git a/changelogs/fragments/ansible-test-sanity-runtime-metadata.yml b/changelogs/fragments/ansible-test-sanity-runtime-metadata.yml new file mode 100644 index 00000000000..a15fca2a6e4 --- /dev/null +++ b/changelogs/fragments/ansible-test-sanity-runtime-metadata.yml @@ -0,0 +1,2 @@ +minor_changes: + - ansible-test - Update the ``runtime-metadata`` sanity test to handle a new warning on Python 3.10. diff --git a/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py b/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py index 53ea00fc5ae..29b4ac4bfa7 100755 --- a/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py +++ b/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py @@ -7,6 +7,18 @@ import datetime import os import re import sys +import warnings + +# Temporary solution for the PEP 632 deprecation warning on Python 3.10. +# This should be removed once distutils.version has been vendored in ansible.module_utils. +# See: https://github.com/ansible/ansible/issues/74599 +# pylint: disable=wrong-import-position +warnings.filterwarnings( + 'ignore', + 'The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives', + DeprecationWarning, +) + from distutils.version import StrictVersion, LooseVersion from functools import partial