Skip to main content

Module loader

Module loader 

Source
Expand description

Load a Python plugin package and produce a PythonPluginHandle whose method-index map lets the host dispatch by index just like the cdylib path.

Loading steps:

  1. Read the package’s package.toml and assert runtime = "python".
  2. Prepend <dir>/vendor and <dir> to sys.path (idempotent — repeated loads of the same package don’t insert twice).
  3. Import the entry module declared in [python].entry_module.
  4. Validate the module’s __interface_hash__ constant against the descriptor passed by the host. Mismatch = clean load error.
  5. Look up each method by name (in the descriptor’s order) so vtable indices resolve to Python callables at call time.

What we don’t do here: subprocess spawning, venv creation, or cancellation. All Python work happens in the host’s embedded interpreter (T-0085).

Enums§

PythonLoadError
Errors that can happen during Python plugin load.

Functions§

load_python_plugin
Load a Python plugin package against a static interface descriptor.