-
Notifications
You must be signed in to change notification settings - Fork 772
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
[python] fix compatibility for Python 3.12 #24605
Merged
Merged
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
nbdd0121
force-pushed
the
pyproject
branch
11 times, most recently
from
September 23, 2024 16:05
a5c5e1a
to
53412be
Compare
We only use importlib.metadata.version which is available in Python 3.8. Signed-off-by: Gary Guo <[email protected]>
pkg_resources is removed in Python 3.12 and replaced by `importlib.resources`. `importlib.resources` however is available in Python 3.9+, so use a polyfill library instead. Signed-off-by: Gary Guo <[email protected]>
nbdd0121
changed the title
[python] remove pkg_resources usage
[python] fix compatibility for Python 3.12
Sep 23, 2024
jwnrt
approved these changes
Sep 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Razer6
reviewed
Sep 24, 2024
The current version that we pinned does not build on or work with Python 3.12. lxml, PyYAML, flake8 are upgraded to latest, while libcst is upgraded to a non-latest version because the latest version dropped Python 3.8 support. Signed-off-by: Gary Guo <[email protected]>
pamaury
approved these changes
Sep 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a python expert but this looks reasonable to me
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.
Fix #24360
pkg_resources is removed in Python 3.12 and replaced by
importlib.resources
.importlib.resources
however is available in Python 3.9+, so use a polyfill library instead.Bump a bunch of dependencies to the version that supports 3.12.