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
Create python3.8 parser #3384
Create python3.8 parser #3384
Conversation
xonsh/parsers/v38.py
Outdated
@@ -0,0 +1,307 @@ | |||
# -*- coding: utf-8 -*- | |||
"""Implements the xonsh parser for Python v3.6.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be for 3.8 😉
This is awesome! Thanks @gforsyth! Do we need any more tests here? Also, should probably enable CI for 3.8 before merging. I belive that conda-forge has packages for everything we need for xonsh now for v3.8 |
Hrrrr, so yeah, we need more tests. Also, on 3.8 current parser tests are failing. I believe this is due to a change in the AST in python 3.8 -- there are now two additional attributes for little bit of info here: https://docs.python.org/3.8/library/ast.html#ast.AST.lineno Also looks like 6 tests are failing because |
Hmm, interesting. All of the failures involve decorators:
|
This builds on earlier work by @carmenbianca -- I've moved the 3.8+ specific parser code (involving the `posonlyargs`) to a python 3.8 parser class that inherits from the 3.6 parser.
Ok, this is ready for another look. I think that at this stage it actually doesn't need more tests, in that all this PR is doing is making sure that xonsh can run on Python 3.8. Python 3.8 is now enabled in CI and tests are passing, so huzzah! And @scopatz, it looks like 3.8 changed a bit of the AST involving decorator position that you found a bit odd, as per this comment: https://github.com/xonsh/xonsh/blob/master/xonsh/parsers/base.py#L823-L826 There is a much bigger lift which is adding support for positional-only parameter support which landed in 3.8: https://www.python.org/dev/peps/pep-0570/#syntax-and-semantics This is going to require a bit of extra noodling in the parser to handle all the new possible function signatures (I'm playing with this but someone else should feel free to take a crack at it, too). |
Ping @xonsh/xore |
Anyone in @xonsh/xore available to take a look at this? |
This builds on earlier work by @carmenbianca -- I've moved the 3.8+
specific parser code (involving the
posonlyargs
) to a python 3.8parser class that inherits from the 3.6 parser.