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

[python] fix compatibility for Python 3.12 #24605

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Conversation

nbdd0121
Copy link
Contributor

@nbdd0121 nbdd0121 commented Sep 19, 2024

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.

@nbdd0121 nbdd0121 force-pushed the pyproject branch 11 times, most recently from a5c5e1a to 53412be Compare September 23, 2024 16:05
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 nbdd0121 changed the title [python] remove pkg_resources usage [python] fix compatibility for Python 3.12 Sep 23, 2024
@nbdd0121
Copy link
Contributor Author

Copy link
Contributor

@jwnrt jwnrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

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]>
Copy link
Contributor

@pamaury pamaury left a 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

@jwnrt jwnrt merged commit 8d0e999 into lowRISC:master Sep 30, 2024
38 checks passed
@nbdd0121 nbdd0121 deleted the pyproject branch September 30, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[python] Add support for python 3.12
4 participants