MCPcopy Index your code
hub / github.com/python/mypy / normalize_meta

Function normalize_meta

misc/diff-cache.py:68–78  ·  view source on GitHub ↗

Normalize a CacheMeta instance to avoid spurious diffs. Zero out mtimes and sort dependencies deterministically.

(meta: CacheMeta)

Source from the content-addressed store, hash-verified

66
67
68def normalize_meta(meta: CacheMeta) -> None:
69 """Normalize a CacheMeta instance to avoid spurious diffs.
70
71 Zero out mtimes and sort dependencies deterministically.
72 """
73 # TODO: handle dep_hashes here and in relevant parts below.
74 meta.mtime = 0
75 meta.data_mtime = 0
76 meta.dependencies, meta.suppressed, meta.dep_prios, meta.dep_lines = sort_deps(
77 meta.dependencies, meta.suppressed, meta.dep_prios, meta.dep_lines
78 )
79
80
81def serialize_meta_ff(meta: CacheMeta, version_prefix: bytes) -> bytes:

Callers 1

loadFunction · 0.85

Calls 1

sort_depsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…