Skip to main content

Module cache

Module cache 

Source
Expand description

Disk-backed caches for content-immutable lookups.

Two caches live here:

  • DiskItemsCache — parsed public-API items keyed by (blob_sha, Language). Blob SHAs are content hashes, so the cached parse result is correct forever for the same key.
  • DiskPrCache — pull-request metadata keyed by (owner, repo, sha). Once a commit is associated with a merged PR, that fact is immutable; safe to cache forever.

Default location: $XDG_CACHE_HOME/entropyx/, falling back to ~/.cache/entropyx/. Override via $ENTROPYX_CACHE_DIR. Cache files are JSON for inspectability; cache directory is created on save if missing.

Structs§

DiskItemsCache
SHA-keyed cache of parsed public-API items, persisted as JSON.
DiskPrCache
(owner, repo, sha)-keyed cache of pull-request lookups, persisted as JSON. None values are stored explicitly to record “queried, no PR found” — distinct from “never queried” (cache miss).

Functions§

default_cache_dir
Resolve the default cache directory. Returns None only when none of $ENTROPYX_CACHE_DIR, $XDG_CACHE_HOME, or $HOME is set.