Updates to support python 3.9 AST#2225
Merged
Merged
Conversation
this is required to fix a bug present when running in python3.9
fubuloubu
approved these changes
Nov 27, 2020
This file contains hidden or 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
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.
What I did
Update the
vyper.astsubpackage to handle changes introduced in the python AST in version 3.9.Related to #2182
Closes #2205
Closes #2206
How I did it
The only change in 3.9 relevant to Vyper was the deprecation of the
Indexnode class:This node is exclusively used within
sliceattribute of theSubscriptnode - starting in 3.9,slicenow containsIndex.valuedirectly.I had to get hacky to sidestep the logic that prevents direct instantiation of
Index. It works, I've explained it in the docstring, but this is a great example of why we really need our own parser.How to verify it
We're unable to run the test suite against python 3.9 in the CI, because of a lack of support from an upstream dependency: ApeWorX/blake2b-py#2
I've run the tests locally and verified that everything is passing. I think we should merge this PR now, and once our test deps support 3.9 we can announce official support.
Cute Animal Picture