-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Incorporate import_expression logic into jishaku. #231
Incorporate import_expression logic into jishaku. #231
Conversation
- Modify logic from Sachaa-Thanasius/experimental. - Copy modified tests. - Substitute import_expression.parse with inline_import.parse. - Remove IMPORTER.
- Fix test break, since `tokenize.tokenize` has buggy behavior that wasn't backported. - See python/cpython#79288 and python/cpython#88833. - Adjust typing using so everything from typing is prepended with `typing.`.
On a tangential note: it was mentioned in the related issue that the inline import feature should pass "the litmus test" on 3.8-3.12, but in the overall tracking issue for the next release (#212), it was also mentioned that jishaku would get a bump to 3.10. Is the latter still true, and if so, do I only have to care about this being compatible with 3.10+? |
- `typing_extensions` is a direct dependency, so using it directly is fine. - `copy_annotations()` was using functools.wraps with the wrong function as the wrapper.
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.
It's looks like ok
Since ioistired is back, I'll close this PR once upstream has been fixed. |
Closes scarletcafe#231 Closes scarletcafe#228
Closes scarletcafe#231 Closes scarletcafe#228
Rationale
import_expression
is effectively unmaintained and isn't functional on python3.12 (according the issue linked below). The new logic should be functional on 3.8+.Closes #228.
Summary of changes made
Adds a token stream transformer and AST transformer and incorporates them into a parse function with the same signature as
ast.parse
to achieve a similar end result toimport_expression.parse
. Also added tests, mostly sourced fromimport_expression
and modified to account for the different and much smaller API surface.Checklist