pub struct VenvConfig {
pub class_name: String,
pub requirements_file: Option<String>,
pub script_path: String,
pub max_content_size: usize,
pub timeout_secs: u64,
}Expand description
Venv-relevant settings, parsed from a plugin entry’s opaque config map.
PluginConfig has no fields for a class name, a content-size cap, or a
per-plugin timeout — those are host-specific, so they live in the
free-form config value and are parsed here.
§plugin_dirs is deliberately absent
A plugin_dirs: key in this block is ignored; a top-level
plugin_dirs: YAML key fails the config load. Plugin directories are not configurable: the host
always uses <project root>/plugins, which is where cpex plugin install
puts them. See DEFAULT_PLUGIN_DIR. Serde ignores unknown fields, so an
existing config that still carries the key parses without error — the value
simply has no effect.
Fields§
§class_name: StringFully-qualified Python class implementing the plugin, e.g.
my_pkg.filters.PiiFilter. Required: the worker needs it to import
and instantiate the plugin, and the venv cache is keyed on it.
requirements_file: Option<String>Requirements file to install into the venv, relative to the package root. Optional — a plugin installed by FQN conversion gets its dependencies from the install channel, not a requirements file, and then the manifest version plus hash is the sole cache signal.
script_path: StringWorker script path inside the venv. Defaults to the framework’s
worker.py; overridable for tests and for a host that vendors its own.
max_content_size: usizeCap on one serialized outbound task, in bytes.
timeout_secs: u64Per-invocation timeout, in seconds. Falls back to the framework default when absent.
Implementations§
Source§impl VenvConfig
impl VenvConfig
Sourcepub fn from_plugin_config(
config: &PluginConfig,
) -> Result<Self, Box<PluginError>>
pub fn from_plugin_config( config: &PluginConfig, ) -> Result<Self, Box<PluginError>>
Parse the venv settings out of a plugin entry’s config map.
A missing or malformed class_name is a config error, not a panic —
the engine surfaces it against the plugin name at load time.