TODO list for Python 3.11 support
- [ ] Re-enable
numpyas a test dependency once they provide wheels for3.11> See #1517 - [ ] Remove the
if: ${{ always() }}line from thecoverageCI jobs
Some recent AST changes:
- Add support for new
TryStarnode. Almost identical to theast.Trynode. We shouldn't use the oldTryExcept/TryFinallystructure though! It's probably better to look at #1389 https://docs.python.org/3.11/library/ast.html#ast.TryStar https://github.com/python/cpython/pull/29581 -
FormattedValue.conversionis a required field (instead of optional). This was an error in the Python documentation which was addressed recently. https://docs.python.org/3.11/library/ast.html#ast.FormattedValue https://github.com/python/cpython/pull/30467 - [Optional] We could add an enum for
FormattedValue.conversion. The int values can be confusion on its own.
The wrapt dependency needs to be ">=1.14" for python 3.11. See changelog
@rkhwaja I think pip handle that, if pylint require wrapt >= 1.12 but python 3.11 require wrapt >= 1.14 then pip download >= 1.14. We should not change our lower bound, as we could imagine that wrapt >=1.14 is incompatible with python 3.7 and changing this would break pylint for python 3.7.
You could add a dependency like "wrapt>=1.14,<2;python_version>='3.11'" and then both the old and the new python will work.
I don't know if you have other users than pylint but they would all just work too if you did it this way.
But is this required at all ? wrapt is the package that should handle the metadata about the pytho interpreters it supports and pip takes it into account.
But is this required at all ?
wraptis the package that should handle the metadata about the pytho interpreters it supports and pip takes it into account.
Took me a moment to understand the issue. wrap doesn't pin a max supported version (which is the recommendation). Thus pip will happily install 1.12 even on python 3.11 if the dependency resolution requires it. However, only 1.14 is compatible. The options
- Add
wrapt>=1.14,<2;python_version>='3.11'like @rkhwaja suggested - Or just bump the min requirement to
1.14.1.14is compatible with Python>=3.5so that wouldn't be an issue. - End-users can always add the
wrapt>=1.14constraint themselves. Although that won't fix existing environments.
- Or just bump the min requirement to
1.14.1.14is compatible with Python>=3.5so that wouldn't be an issue.
See https://github.com/PyCQA/astroid/pull/1745