Old updaters keep running after the checkout changes. Returning None from their removed uv helpers enables a pip fallback against the new tree. Keep the historical imports as inert shims and stop dependency entrypoints with a relaunch message instead. Do not call PM or write recovery markers from that mixed-version process. Self-managed source launches use PM's successful input stamp to decide when dependencies need a sync. Restart on the managed interpreter before activating the selected generation. Preserve launcher forms and options, and do not sync while a live updater owns the installation. Targeted runtime batch: 225 passed, 8 platform skips. Real PM worker tests build and publish disposable dependency generations, retain prior state on failure, and exercise fresh-process relaunch before dependency activation. The final launch guard test also passes. Full suite and native Windows execution were not run locally.
46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
"""Shims to stop the old updater doing work until relaunch.
|
|
|
|
An updater already in memory imports these names after replacing its checkout.
|
|
They must not install anything, delegate to PM, or return a falsy value that
|
|
would send that old process down its pip fallback. New code must not use them.
|
|
"""
|
|
|
|
from pathlib import Path
|
|
from typing import NoReturn
|
|
|
|
from hermes_cli._old_updater import stop_for_relaunch
|
|
|
|
|
|
def ensure_uv(*args, **kwargs) -> NoReturn:
|
|
# Shim to stop the old updater doing work until relaunch. Older releases
|
|
# expect a tuple, newer ones a path. Exit before either can consume it.
|
|
stop_for_relaunch()
|
|
|
|
|
|
def update_managed_uv(*args, **kwargs) -> NoReturn:
|
|
# Shim to stop the old updater doing work until relaunch.
|
|
stop_for_relaunch()
|
|
|
|
|
|
def resolve_uv(*args, **kwargs) -> NoReturn:
|
|
# Shim to stop the old updater doing work until relaunch, not enable pip.
|
|
stop_for_relaunch()
|
|
|
|
|
|
def managed_python_env(
|
|
project_root: Path | None = None,
|
|
*,
|
|
install_dir: Path | None = None,
|
|
base_env: dict[str, str] | None = None,
|
|
**kwargs,
|
|
) -> NoReturn:
|
|
# Shim to stop the old updater doing work until relaunch, not prepare a child.
|
|
stop_for_relaunch()
|
|
|
|
|
|
def rebuild_venv(
|
|
uv_bin: str, venv_dir: Path, python_version: str = "3.11", **kwargs
|
|
) -> NoReturn:
|
|
# Shim to stop the old updater doing work until relaunch, not claim a rebuild.
|
|
stop_for_relaunch()
|