Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #3936/a2f72be6 backport][stable-4] Prepare for distutils.version being removed in Python 3.12 #3941

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Dec 24, 2021

This is a backport of PR #3936 as merged into main (a2f72be).

SUMMARY

distutils has been deprecafed and will be removed from Python's stdlib in Python 3.12 (see https://www.python.org/dev/peps/pep-0632/). This PR replaces the use of distutils.version.LooseVersion and distutils.version.StrictVersion with LooseVersion from the vendored copy of distutils.version included with ansible-core 2.12 (ansible/ansible#74644) if available, and falls back to distutils.version for ansible-core 2.11 and before. Since ansible-core 2.11 and earlier do not support Python 3.12 (since they use LooseVersion itself in various places), this incomplete fix should be OK for now. Also, the way this PR works (by adding a new module_utils version that abstracts away where LooseVersion comes from), it is easy to also fix this for ansible-core 2.11 and earlier later on.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

Various modules and plugins

* Prepare for distutils.version being removed in Python 2.12.

* Fix copy'n'paste error.

* Re-add Loose prefix.

* Fix Python version typos.

* Improve formulation.

* Move message into own line.

* Fix casing, now that the object is no longer called Version.

(cherry picked from commit a2f72be)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug cloud database files filter filter plugin gitlab identity inventory inventory plugin module module module_utils module_utils monitoring needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR net_tools new_contributor Help guide this first time contributor notification os packaging plugins plugin (any type) source_control system web_infrastructure and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Dec 24, 2021
@felixfontein felixfontein merged commit 9b57221 into stable-4 Dec 24, 2021
@felixfontein felixfontein deleted the patchback/backports/stable-4/a2f72be6c8d36c0b836755093e2837518b2e5869/pr-3936 branch December 24, 2021 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants