Remove use of deprecated ast.Num
for Python 3.12
#10886
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.
Summary
Since Python 3.8 (our minimum supported version), this has been silently deprecated in favour of the catch-all
ast.Constant
(whichNum
subclasses). In Python 3.12, this deprecation is elevated to a warning, which will cause a failure in our test suite when it releases.Details and comments
This alone doesn't get us all the way to full logical Python 3.12 support. #10305 is still an issue, and becomes a larger problem because Numpy 1.24 doesn't have Python 3.12 wheels. There are currently some problems with
python-subunit
,testtools
andstestr
with Python 3.12 that will need addressing upstream before we can run our test suite (I had to use a Python 3.10 host to runstestr
with the parallel runners using Python 3.12rc3 to run the tests). I'm not clear what thestestr
problem was, buttesttools
suffers from the removal ofdistutils
andpython-subunit
from use of the deprecateddatetime.datetime.utcnow
.Symengine of course does not have Python 3.12 wheels yet, and I haven't bothered trying to build one locally myself.