generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Prepare for distutils.version being removed in Python 3.12 #258
Merged
felixfontein
merged 8 commits into
ansible-collections:main
from
felixfontein:distutils.version
Dec 24, 2021
Merged
Prepare for distutils.version being removed in Python 3.12 #258
felixfontein
merged 8 commits into
ansible-collections:main
from
felixfontein:distutils.version
Dec 24, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
felixfontein
force-pushed
the
distutils.version
branch
from
December 22, 2021 22:30
52e894d
to
466424f
Compare
briantist
approved these changes
Dec 23, 2021
felixfontein
changed the title
Prepare for distutils.version being removed in Python 2.12
Prepare for distutils.version being removed in Python 3.12
Dec 23, 2021
felixfontein
commented
Dec 23, 2021
Backport to stable-1: 💚 backport PR created✅ Backport PR branch: Backported as #260 🤖 @patchback |
patchback bot
pushed a commit
that referenced
this pull request
Dec 24, 2021
* Prepare for distutils.version being removed in Python 2.12. * Fix copy'n'paste error. * Fix import. * Re-add Loose prefix. * Fix Python version typo. * Improve formulation. * Move message into own line. * Fix casing, now that the object is no longer called Version. (cherry picked from commit 4b235a2)
@briantist thanks for reviewing this! |
felixfontein
added a commit
that referenced
this pull request
Dec 24, 2021
* Prepare for distutils.version being removed in Python 2.12. * Fix copy'n'paste error. * Fix import. * Re-add Loose prefix. * Fix Python version typo. * Improve formulation. * Move message into own line. * Fix casing, now that the object is no longer called Version. (cherry picked from commit 4b235a2) Co-authored-by: Felix Fontein <[email protected]>
This was referenced Jan 4, 2022
This was referenced Jan 4, 2022
This was referenced Mar 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
COMPONENT NAME
Various modules and plugins