Allow nativeparse to parse source code directly#21260
Conversation
|
Current CI failure is due to changed typing signature of |
This comment has been minimized.
This comment has been minimized.
c8c10dd to
ac275e4
Compare
This comment has been minimized.
This comment has been minimized.
444f4e9 to
149e459
Compare
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
|
CI failures:
Is it possible for CI to run a non-released version of |
This comment has been minimized.
This comment has been minimized.
Resolves #21 Tests are part of python/mypy#21260
This is mostly needed for #21260
ilevkivskyi
left a comment
There was a problem hiding this comment.
I have one comment for now. Also it looks like parallel type-checking is somehow broken by this.
|
|
||
| Raise CompileError if there is a parse error. | ||
| """ | ||
| file_exists = self.fscache.exists(path, real_only=True) |
There was a problem hiding this comment.
I think you can:
- Remove other two call sites to
fscache.exists()in this file (and update relevant code). - Remove
real_onlyparameter and related logic fromfscache. IIRC it is only needed for native parser.
This comment has been minimized.
This comment has been minimized.
|
Line 31 in 488a646 - if options.native_parser:
+ if options.native_parser and source:
Oops, "parallel checking" would |
|
Hint: |
|
Btw, I added some logging, and it looks like we sometimes pass a non-empty |
|
Yeah, we eagerly read the file if there is only one file in the parse batch. Anyway, no need to fix it in this PR since this is a pre-existing problem, you can just fix the crash by passing an actual source (which should be |
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This is the mypy counterpart of mypyc/ast_serialize#54