mod compat;
mod download;
mod runtime;
pub use runtime::{PythonRuntime, is_python_available, suggest_module_path};
#[derive(Debug, thiserror::Error)]
pub enum PythonError {
#[error("failed to download Python runtime: {0}")]
Download(String),
#[error("checksum mismatch: expected {expected}, got {actual}")]
ChecksumMismatch {
expected: String,
actual: String,
},
#[error("Python execution failed: {0}")]
Execution(String),
#[error("serialization error: {0}")]
Serialization(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("WASM runtime error: {0}")]
Wasm(#[from] wasmtime::Error),
#[error("Python plugin module not found: {0}")]
ModuleNotFound(String),
#[error("Python plugin '{0}' is a C extension and cannot run in WASI sandbox")]
CExtensionNotSupported(String),
#[error("Python runtime unavailable: {0}")]
RuntimeUnavailable(String),
}