pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

Declarative modules submodules don't work with `#[pyo3::prelude::pymodule]`

Open alex opened this issue 1 year ago • 0 comments

pyca/cryptography avoids using the prelude, and instead references things with their full name.

This does not work with declarative modules's submodules:

#[pyo3::prelude::pymodule]
mod foo {
    // `submod` won't actually be registered!
    #[pyo3::prelude::pymodule]
    mod submod {}
}

This is because we specifically look for #[pymodule], but don't allow the full name: https://github.com/PyO3/pyo3/blob/main/pyo3-macros-backend/src/module.rs#L213

We should allow the full name to work.

alex avatar Jun 25 '24 22:06 alex