You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While we became able to parse python 3.8 syntax using libCST via #10907 regardless of the pants python version, we lost the ability to parse e.g. python 3.9 syntax by running pants with python 3.9. We could introduce a workaround using just the ast module as we did before #10907, but it would be fantastic if we could instead contribute that change to libCST itself!
Instagram/LibCST#285 describes that it's likely no major changes to the parser will be necessary until after 3.10, so it's likely to be more feasible to do this for 3.9 and 3.10 than for later.
Let's make sure we search for any existing issues in that repo describing progress on 3.9 support before diving in!
The text was updated successfully, but these errors were encountered:
Eric-Arellano
changed the title
support parsing python 3.9/3.10 syntax with libCST
Support parsing python 3.9/3.10 syntax for dependency inference
Nov 13, 2020
@jsirois pointed out the sensible fix for this is to stop "cheating" by parsing the Python AST in-memory through Pants. Instead, we should be subprocessing. While this may have a perf hit, we are going to need to subprocess for most other languages, so we should figure this out earlier.
This completely solves the interpreter constraints issue. We will choose the interpreter based on the interpreter_constrains field, like we always do. Then use the builtin ast module, rather than typed-ast. No need for guessing what the file is.
I'll be working on this the next week as part of a broader push to support Pants on more platforms.
While we became able to parse python 3.8 syntax using libCST via #10907 regardless of the pants python version, we lost the ability to parse e.g. python 3.9 syntax by running pants with python 3.9. We could introduce a workaround using just the
ast
module as we did before #10907, but it would be fantastic if we could instead contribute that change to libCST itself!Instagram/LibCST#285 describes that it's likely no major changes to the parser will be necessary until after 3.10, so it's likely to be more feasible to do this for 3.9 and 3.10 than for later.
Let's make sure we search for any existing issues in that repo describing progress on 3.9 support before diving in!
The text was updated successfully, but these errors were encountered: