monty-pool 1.5.0

A secure, snapshotable Python sandbox written in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mod build;

use std::{env, path::PathBuf, sync::OnceLock};

/// Locates and builds the `monty` CLI once per test binary.
pub fn monty_binary() -> PathBuf {
    static BINARY: OnceLock<PathBuf> = OnceLock::new();

    if let Some(path) = env::var_os("MONTY_TEST_BIN") {
        return PathBuf::from(path);
    }
    BINARY
        .get_or_init(|| build::binary(&["-p", "monty-runtime"], "monty"))
        .clone()
}