Dependencies: Add support for Python 3.12 #6161
Merged
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