Soft deprecate ansible.module_utils.six (#86048)

pull/86044/head
sivel / Matt Martz 1 month ago committed by GitHub
parent 6dd48814f2
commit e4b4787c02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,3 @@
deprecated_features:
- >
``ansible.module_utils.six`` - The ``six`` compatibility library provided at ``ansible.module_utils.six`` is deprecated, and planned for removal in ansible-core 2.24

@ -33,6 +33,8 @@ import operator
import sys
import types
# deprecated: description="Replace with ansible.module_utils.common.warnings.deprecate for 2.24" core_version="2.22"
# The following makes it easier for us to script updates of the bundled code. It is not part of
# upstream six
_BUNDLED_METADATA = {"pypi_name": "six", "version": "1.17.0"}

@ -110,6 +110,10 @@ class AnsibleUnwantedChecker(BaseChecker):
'Iterator',
)
),
'ansible.module_utils.six': UnwantedEntry(
'the Python standard library equivalent'
),
}
unwanted_functions = {
@ -134,14 +138,6 @@ class AnsibleUnwantedChecker(BaseChecker):
modules_only=True),
}
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
# ansible.module_utils.six is deprecated and collections can still use it until it is removed
if self.is_ansible_core:
self.unwanted_imports['ansible.module_utils.six'] = UnwantedEntry(
'the Python standard library equivalent'
)
@functools.cached_property
def is_ansible_core(self) -> bool:
"""True if ansible-core is being tested."""

Loading…
Cancel
Save