seqme.models.ThirdPartyModel#
- class seqme.models.ThirdPartyModel(entry_point, path, url=None, branch=None, shallow=True)[source]#
Wrapper for loading and calling a third-party plugin model.
Clones a Git repository into a local directory (if not already present) and invokes a specified function from that repository in an isolated uv environment.
uv is used over conda because it provides precise lockfile-based reproducibility, strict package version pinning, and per-project Python version isolation — ensuring the plugin runs in exactly the environment its author intended.
- __init__(entry_point, path, url=None, branch=None, shallow=True)[source]#
Initialize the third-party model.
- Parameters:
entry_point (
str) – Module and function to call, in the form ‘module.path:function’.path (
str|Path) – Path to the plugin repository. Cloned here if it does not exist and url is provided.url (
Optional[str]) – Git repository URL to clone (optionally prefixed with ‘git+’). If None, path must already exist.branch (
Optional[str]) – Branch to clone. If None, clones the default branch.shallow (
bool) – If True, clones only the latest commit (no full history). Defaults to True.
- Raises:
ValueError – If entry_point is not of the form ‘module:function’.
FileNotFoundError – If path does not exist and no url is provided.
- __call__(*args, **kwargs)[source]#
Execute the plugin’s function with the given arguments.
- Parameters:
*args – Positional arguments passed to the plugin function.
**kwargs – Keyword arguments passed to the plugin function.
- Return type:
- Returns:
The return value of the plugin function.
Methods