39 lines
896 B
Python
39 lines
896 B
Python
|
|
"""Public contract for the test_sample plugin.
|
||
|
|
|
||
|
|
Exposes only the symbols that other builtins plugins need.
|
||
|
|
Importers should use::
|
||
|
|
|
||
|
|
from app.plugins.builtins.contracts import get_contract
|
||
|
|
ts = get_contract("test_sample")
|
||
|
|
if ts:
|
||
|
|
# use ts.TestSamplePlugin
|
||
|
|
|
||
|
|
instead of importing from internal modules directly.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from app.plugins.builtins.contracts import get_contract_registry
|
||
|
|
from app.plugins.builtins.test_sample import TestSamplePlugin
|
||
|
|
|
||
|
|
|
||
|
|
class TestSampleContract:
|
||
|
|
"""Public API surface for the test_sample plugin."""
|
||
|
|
|
||
|
|
contract_name = "test_sample"
|
||
|
|
|
||
|
|
# ─── plugin class ───
|
||
|
|
TestSamplePlugin = TestSamplePlugin
|
||
|
|
|
||
|
|
|
||
|
|
# ─── self-registration ───
|
||
|
|
|
||
|
|
_contract = TestSampleContract()
|
||
|
|
get_contract_registry().register("test_sample", _contract)
|
||
|
|
|
||
|
|
|
||
|
|
__all__ = [
|
||
|
|
"TestSampleContract",
|
||
|
|
"TestSamplePlugin",
|
||
|
|
]
|