everpatch is a standalone patch queue engine for carrying durable patch sets
across evolving upstream repositories.
It is repo-agnostic:
- target repository is supplied at runtime
- patch packs are discovered from any directory
- each patch is responsible for its own structure-aware detect/apply logic
Run against a repository with a patches/ directory:
everpatch apply --repo-root /path/to/repo --patch-root /path/to/patchesDry-run:
everpatch apply --repo-root /path/to/repo --patch-root /path/to/patches --dry-runDetect only:
everpatch detect --repo-root /path/to/repo --patch-root /path/to/patchesJSON output:
everpatch apply --repo-root /path/to/repo --patch-root /path/to/patches --jsonEach patch directory contains:
patch.py(required)patch.json(optional metadata)verify.sh(optional, ifpatch.pydoes not defineverify)
Patch API in patch.py:
detect(ctx)or legacydetect(repo_root)-> dict withapplied: boolapply(ctx, dry_run=False)or legacyapply(repo_root, dry_run=False)- optional
verify(ctx)or legacyverify(repo_root)->(ok, message)orbool
ctx exposes:
ctx.repo_root: target repo pathctx.patch_root: root directory used for discoveryctx.patch_dir: current patch directoryctx.metadata: parsedpatch.jsoncontent
Verification runs for each patch unless --skip-verify or --dry-run is set.
Order:
- patch
verify(...)function (if present) verify.shscript (if present)- no-op success
For verify.sh, these environment variables are provided:
EVERPATCH_REPO_ROOTEVERPATCH_PATCH_ROOTEVERPATCH_PATCH_DIREVERPATCH_PATCH_ID
examples/torch_spyre_dma_patch contains the original DMA helper/pybind patch
as a portable example patch pack for torch-spyre.