Update JSON export tool to support binary meta cache files#20096
Update JSON export tool to support binary meta cache files#20096
Conversation
| @@ -1,4 +1,4 @@ | |||
| """Tool to convert mypy cache file to a JSON format (print to stdout). | |||
| """Tool to convert binary mypy cache files (.ff) to JSON (.ff.json). | |||
There was a problem hiding this comment.
| """Tool to convert binary mypy cache files (.ff) to JSON (.ff.json). | |
| """Tool to convert binary mypy cache files (.ff) to JSON (.json). |
There was a problem hiding this comment.
Oh, I see you actually don't strip the original extension. I think it is better to do this, i.e. use .data.json or .meta.json for output files.
There was a problem hiding this comment.
I did it this way so that there is no confusion between the "real" JSON cache files and the ones produced by the converter -- there's no guarantee that mypy will be able to read the output, since we don't guarantee that it stays in sync with the actual JSON format.
This comment has been minimized.
This comment has been minimized.
|
Interesting, file hashes appear to be different on Windows. Maybe it's due to CRLF conversion. I will investigate -- maybe the test found a minor bug or at least inconsistency. |
|
@JukkaL do you want to include this one in the release? There is still a failing test on Windows. |
|
I think we should flip the default for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@JukkaL for now I simply skip the size and hash comparison on Windows, this is likely a newline-related thing. All tests pass now, so that this is ready to be merged. |
|
@JukkaL if you don't have objections, I would merge this one, just to tick that checkbox. |
|
Ah I lost track of this. Thanks for working around the Windows issue! |
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
The test case needs to filter out quite a few things that are unpredictable.