-
Notifications
You must be signed in to change notification settings - Fork 184
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
Dependencies: Add support for Python 3.12 #6161
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
sphuber
force-pushed
the
feature/python-3.12
branch
4 times, most recently
from
October 25, 2023 13:58
0c12356
to
51da042
Compare
Wow, that was much faster than Python 3.11, cool! |
sphuber
force-pushed
the
feature/python-3.12
branch
2 times, most recently
from
October 25, 2023 14:38
63e8b39
to
2b10445
Compare
Well, we are not quite there yet 😉 the tests are actually hanging on Python 3.12 and we need the |
sphuber
force-pushed
the
feature/python-3.12
branch
from
October 26, 2023 11:23
29da25f
to
a9a8828
Compare
sphuber
force-pushed
the
feature/python-3.12
branch
6 times, most recently
from
November 16, 2023 09:00
973de81
to
b5009f2
Compare
The file `requirements/requirements-py-3.12.txt` is added which provides a complete environment for Python 3.12. The CI is updated to add Python 3.12 in all strategy matrices or replace Python 3.11 where only the oldest and latest Python version are tested. Note that the Python version for the `pre-commit` jobs are kept at 3.10 for now. The reason is that in Python 3.12 f-strings are improved by allowing nested quotes. For example: f'some_dict['key']' is now supported, whereas before Python 3.12 this would not work since the nested quotes would not be parsed correctly and the internal quotes had to be either escaped or changed for double quotes. A number of dependencies had to be updated to make them compatible with Python 3.12, usually because older version still relied on the `distutils` and `pkg_resources` standard lib modules which have been removed. The `utils/dependency_management.py` had to be updated similarly to replace `pkg_resources` with `packaging`. The latter had to be updated to `packaging==23.0` in order to have the `__eq__` implementation for the `Requirement` class which the script relies on. The memory leak tests are skipped on Python 3.12 because currently they hang. The problem is with the `pympler.muppy.get_objects` method. This calls `gc.collect` internally, but that call is blocking. The exact cause is as of yet unknown. The garbage collecting has been changed in Python 3.12 so it is not completely unexpected either. The `sphinxcontrib-details-directive` dependency is removed. It was used for the sphinx extension to add the ports of port namespaces in HTML's `<details>` tags, allowing them to be collapsed. This could help with readability in case of large namespaces. However, this package breaks on Python 3.12 since it imports the deprecated `pkg_resources` package. Since the package has not been maintained since 4 years, it is unlikely this will be fixed it and so instead it is removed for now. See https://github.com/sphinx-contrib/sphinxcontrib-details-directive
This dependency was temporarily removed since it didn't yet support sqlalchemy v2, but that has now been released with `v0.2.0`.
sphuber
force-pushed
the
feature/python-3.12
branch
from
November 16, 2023 09:20
b5009f2
to
6e45cf3
Compare
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.
The file
requirements/requirements-py-3.12.txt
is added which providesa complete environment for Python 3.12. The CI is updated to add Python
3.12 in all strategy matrices or replace Python 3.11 where only the
oldest and latest Python version are tested. Note that the Python
version for the
pre-commit
jobs are kept at 3.10 for now. The reasonis that in Python 3.12 f-strings are improved by allowing nested quotes.
For example:
is now supported, whereas before Python 3.12 this would not work since
the nested quotes would not be parsed correctly and the internal quotes
had to be either escaped or changed for double quotes.
A number of dependencies had to be updated to make them compatible with
Python 3.12, usually because older version still relied on the
distutils
andpkg_resources
standard lib modules which have beenremoved. The
utils/dependency_management.py
had to be updated similarlyto replace
pkg_resources
withpackaging
. The latter had to beupdated to
packaging==23.0
in order to have the__eq__
implementation for the
Requirement
class which the script relies on.The
sphinxcontrib-details-directive
dependency is removed. It was usedfor the sphinx extension to add the ports of port namespaces in HTML's
<details>
tags, allowing them to be collapsed. This could help withreadability in case of large namespaces. However, this package breaks on
Python 3.12 since it imports the deprecated
pkg_resources
package.Since the package has not been maintained since 4 years, it is unlikely
this will be fixed it and so instead it is removed for now. See
https://github.com/sphinx-contrib/sphinxcontrib-details-directive