pub fn add_to_python_path() -> Result<Guard, failure::Error> {
    let temp_dir = TempDir::new_labeled("rsp2", "python package source")?;
    let py_package_dir = temp_dir.path().join("rsp2");

    crate::fsx::create_dir(&py_package_dir)?;
    write_dir_contents(&ROOT_DIR, &py_package_dir)?;

    modify_path_env(
        "PYTHONPATH",
        |paths| paths.insert(0, temp_dir.path().into()),
    )?;
    Ok(Guard(temp_dir))
}
/// Writes rsp2 python modules to a temporary directory and adds it to the `PYTHONPATH` environment
/// variable until the returned RAII guard is dropped.
Writes rsp2 python modules to a temporary directory and adds it to the `PYTHONPATH` environment
variable until the returned RAII guard is dropped.
Writes rsp2 python modules to a temporary directory and adds it to the ` PYTHONPATH ` environment variable until the returned RAII guard is dropped .
pub fn add_to_python_path() -> Result<Guard, failure::Error> {
    let temp_dir = TempDir::new_labeled("rsp2", "python package source")?;
    let py_package_dir = temp_dir.path().join("rsp2");
    crate::fsx::create_dir(&py_package_dir)?;
    write_dir_contents(&ROOT_DIR, &py_package_dir)?;
    modify_path_env(
        "PYTHONPATH",
        |paths| paths.insert(0, temp_dir.path().into()),
    )?;
    Ok(Guard(temp_dir))
}
pub fn add_to_python_path ( ) -> Result < Guard , failure :: Error > { let temp_dir = TempDir :: new_labeled ( " " , " " ) ? ; let py_package_dir = temp_dir . path ( ) . join ( " " ) ; crate :: fsx :: create_dir ( & py_package_dir ) ? ; write_dir_contents ( & ROOT_DIR , & py_package_dir ) ? ; modify_path_env ( " " , | paths | paths . insert ( 0 , temp_dir . path ( ) . into ( ) ) , ) ? ; Ok ( Guard ( temp_dir ) ) }
Writes rsp2 python modules to a temporary directory and adds it to the `PYTHONPATH` environment
variable until the returned RAII guard is dropped.
Writes rsp2 python modules to a temporary directory and adds it to the ` PYTHONPATH ` environment variable until the returned RAII guard is dropped .