pub fn write_python_part(
    writer: &mut impl ModuleWriter,
    python_module: impl AsRef<Path>,
    module_name: impl AsRef<Path>,
) -> Result<()> {
    for absolute in WalkDir::new(&python_module) {
        let absolute = absolute?.into_path();

        let relaitve = absolute.strip_prefix(python_module.as_ref().parent().unwrap())?;

        // Ignore the cffi folder from develop, if any
        if relaitve.starts_with(module_name.as_ref().join(&module_name)) {
            continue;
        }

        if absolute.is_dir() {
            writer.add_directory(relaitve)?;
        } else {
            // Ignore native libraries from develop, if any
            if let Some(extension) = relaitve.extension() {
                if extension.to_string_lossy() == "so" {
                    continue;
                }
            }
            writer
                .add_file(relaitve, &absolute)
                .context(format!("File to add file from {}", absolute.display()))?;
        }
    }

    Ok(())
}
/// Adds the python part of a mixed project to the writer,
/// excluding older versions of the native library or generated cffi declarations
Adds the python part of a mixed project to the writer,
excluding older versions of the native library or generated cffi declarations
Adds the python part of a mixed project to the writer excluding older versions of the native library or generated cffi declarations
pub fn write_python_part(
    writer: &mut impl ModuleWriter,
    python_module: impl AsRef<Path>,
    module_name: impl AsRef<Path>,
) -> Result<()> {
    for absolute in WalkDir::new(&python_module) {
        let absolute = absolute?.into_path();
        let relaitve = absolute.strip_prefix(python_module.as_ref().parent().unwrap())?;
        // Ignore the cffi folder from develop, if any
        if relaitve.starts_with(module_name.as_ref().join(&module_name)) {
            continue;
        }
        if absolute.is_dir() {
            writer.add_directory(relaitve)?;
        } else {
            // Ignore native libraries from develop, if any
            if let Some(extension) = relaitve.extension() {
                if extension.to_string_lossy() == "so" {
                    continue;
                }
            }
            writer
                .add_file(relaitve, &absolute)
                .context(format!("File to add file from {}", absolute.display()))?;
        }
    }
    Ok(())
}
pub fn write_python_part ( writer : & mut impl ModuleWriter , python_module : impl AsRef < Path > , module_name : impl AsRef < Path > , ) -> Result < ( ) > { for absolute in WalkDir :: new ( & python_module ) { let absolute = absolute ? . into_path ( ) ; let relaitve = absolute . strip_prefix ( python_module . as_ref ( ) . parent ( ) . unwrap ( ) ) ? ; // Ignore the cffi folder from develop, if any if relaitve . starts_with ( module_name . as_ref ( ) . join ( & module_name ) ) { continue ; } if absolute . is_dir ( ) { writer . add_directory ( relaitve ) ? ; } else { // Ignore native libraries from develop, if any if let Some ( extension ) = relaitve . extension ( ) { if extension . to_string_lossy ( ) == " " { continue ; } } writer . add_file ( relaitve , & absolute ) . context ( format ! ( " " absolute display ( ) ) ) ? ; } } Ok ( ( ) ) }
Adds the python part of a mixed project to the writer,
excluding older versions of the native library or generated cffi declarations
Adds the python part of a mixed project to the writer excluding older versions of the native library or generated cffi declarations
writer
&mut impl ModuleWriter
python_module
impl AsRef<Path>
module_name
impl AsRef<Path>
writer
&mut impl ModuleWriter
python_module
impl AsRef<Path>
module_name
impl AsRef<Path>