Buckets:
| """One-time migration steps that run after an update. | |
| Add a migration when an update needs more than a dependency sync (moving | |
| files, converting configs, clearing caches, etc). Each runs at most once per | |
| environment; applied ids are recorded in the venv state file. | |
| def _example(dry_run): | |
| ... | |
| MIGRATIONS = [ | |
| {"id": "2026-07-example-cache-move", "run": _example}, | |
| ] | |
| """ | |
| from .util import info | |
| from . import env | |
| MIGRATIONS = [] | |
| def run_pending(dry_run=False): | |
| if not MIGRATIONS: | |
| return | |
| state = env.load_state() | |
| applied = set(state.get("migrations", [])) | |
| for migration in MIGRATIONS: | |
| if migration["id"] in applied: | |
| continue | |
| info("Running migration: %s" % migration["id"]) | |
| if not dry_run: | |
| migration["run"](dry_run) | |
| applied.add(migration["id"]) | |
| state["migrations"] = sorted(applied) | |
| env.save_state(state) | |
Xet Storage Details
- Size:
- 943 Bytes
- Xet hash:
- 2d9fba9f8f9c93baec1c7e0b75253690495ffd55cbe18486937ed2b2c0bc312e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.