| 553 | |
| 554 | |
| 555 | def convert_binary_cache_meta_to_json(data: bytes, data_file: str) -> Json: |
| 556 | assert ( |
| 557 | data[0] == cache_version() and data[1] == CACHE_VERSION |
| 558 | ), "Cache file created by an incompatible mypy version" |
| 559 | meta = CacheMeta.read(ReadBuffer(data[2:]), data_file) |
| 560 | assert meta is not None, f"Error reading meta cache file associated with {data_file}" |
| 561 | return { |
| 562 | "id": meta.id, |
| 563 | "path": meta.path, |
| 564 | "mtime": meta.mtime, |
| 565 | "size": meta.size, |
| 566 | "hash": meta.hash, |
| 567 | "data_mtime": meta.data_mtime, |
| 568 | "dependencies": meta.dependencies, |
| 569 | "suppressed": meta.suppressed, |
| 570 | "options": meta.options, |
| 571 | "dep_prios": meta.dep_prios, |
| 572 | "dep_lines": meta.dep_lines, |
| 573 | "dep_hashes": [dep.hex() for dep in meta.dep_hashes], |
| 574 | "interface_hash": meta.interface_hash.hex(), |
| 575 | "version_id": meta.version_id, |
| 576 | "ignore_all": meta.ignore_all, |
| 577 | "plugin_data": meta.plugin_data, |
| 578 | } |
| 579 | |
| 580 | |
| 581 | def main() -> None: |