Built a universal manager and installer for all operating systems and environments. Bumped a lot of versions of things. Still needs deep testing.

This commit is contained in:
Jaret Burkett
2026-07-27 15:10:29 -06:00
parent 7e7053fc9a
commit 1e58c9a0f0
23 changed files with 2350 additions and 146 deletions

34
manager/migrations.py Normal file
View File

@@ -0,0 +1,34 @@
"""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)