openenv/coding_env
21
1"""2Compatibility shim for the historical ``openenv_core`` package.3 4The core runtime now lives under ``openenv.core``. Importing from the old5package path will continue to work but emits a ``DeprecationWarning`` so6downstream users can migrate at their own pace.7"""8 9from __future__ import annotations10 11import importlib12import sys13import warnings14from types import ModuleType15from typing import Dict16 17_TARGET_PREFIX = "openenv.core"18_TARGET_MODULE = importlib.import_module(_TARGET_PREFIX)19 20warnings.warn(21 "openenv_core is deprecated; import from openenv.core instead.",22 DeprecationWarning,23 stacklevel=2,24)25 26__all__ = getattr(_TARGET_MODULE, "__all__", [])27 28 29def __getattr__(name: str):30 return getattr(_TARGET_MODULE, name)31 32 33def __dir__():34 return sorted(set(dir(_TARGET_MODULE)))35 36 37def _alias(name: str) -> None:38 target = f"{_TARGET_PREFIX}.{name}"39 sys.modules[f"{__name__}.{name}"] = importlib.import_module(target)40 41 42for _child in (43 "client_types",44 "containers",45 "env_client",46 "env_server",47 "rubrics",48 "tools",49 "utils",50):51 try:52 _alias(_child)53 except ModuleNotFoundError: # pragma: no cover - defensive54 continue55 