MCPcopy
hub / github.com/python/mypy / write_plugins_snapshot

Function write_plugins_snapshot

mypy/build.py:1726–1734  ·  view source on GitHub ↗

Write snapshot of versions and hashes of currently active plugins.

(manager: BuildManager)

Source from the content-addressed store, hash-verified

1724
1725
1726def write_plugins_snapshot(manager: BuildManager) -> None:
1727 """Write snapshot of versions and hashes of currently active plugins."""
1728 snapshot = json_dumps(manager.plugins_snapshot)
1729 if (
1730 not manager.metastore.write(PLUGIN_SNAPSHOT_FILE, snapshot)
1731 and manager.options.cache_dir != os.devnull
1732 ):
1733 manager.errors.set_file(_cache_dir_prefix(manager.options), None, manager.options)
1734 manager.error(None, "Error writing plugins snapshot", blocker=True)
1735
1736
1737def read_plugins_snapshot(manager: BuildManager) -> dict[str, str] | None:

Callers 1

dispatchFunction · 0.85

Calls 5

json_dumpsFunction · 0.90
_cache_dir_prefixFunction · 0.85
set_fileMethod · 0.80
writeMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…