From fad1c12eac4e87a5d4a5121704bd7f6f3424282f Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 13 Apr 2026 17:26:30 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20fabledscryer=E2=86=92roundtable=20impor?= =?UTF-8?q?t=20alias=20shim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Meta path finder redirects fabledscryer[.*] imports to roundtable[.*], keeping unmodified plugin repos working during the rebrand transition. Co-Authored-By: Claude Opus 4.6 --- roundtable/__init__.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/roundtable/__init__.py b/roundtable/__init__.py index 3dc1f76..a125e63 100644 --- a/roundtable/__init__.py +++ b/roundtable/__init__.py @@ -1 +1,39 @@ __version__ = "0.1.0" + +# Compatibility shim: allow `import fabledscryer[.x.y]` to resolve to +# `roundtable[.x.y]`. Lets unmodified plugin repos keep working during the +# rebrand transition. Remove once all plugins migrate to `roundtable`. +import sys as _sys +import importlib as _importlib +import importlib.abc as _abc +import importlib.util as _util + +_ALIAS = "fabledscryer" + + +class _RoundtableAliasLoader(_abc.Loader): + def __init__(self, real_name): + self._real_name = real_name + + def create_module(self, spec): + return _importlib.import_module(self._real_name) + + def exec_module(self, module): + pass + + +class _RoundtableAliasFinder(_abc.MetaPathFinder): + def find_spec(self, fullname, path=None, target=None): + if fullname != _ALIAS and not fullname.startswith(_ALIAS + "."): + return None + real_name = "roundtable" + fullname[len(_ALIAS):] + if _util.find_spec(real_name) is None: + return None + return _util.spec_from_loader( + fullname, _RoundtableAliasLoader(real_name) + ) + + +if not any(isinstance(f, _RoundtableAliasFinder) for f in _sys.meta_path): + _sys.meta_path.insert(0, _RoundtableAliasFinder()) +_sys.modules.setdefault(_ALIAS, _sys.modules[__name__])