diff --git a/src/lib.rs b/src/lib.rs index 92331e2d..4ecc0ac8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -353,7 +353,7 @@ pub mod proc_macro { #[cfg_attr(docsrs, doc(cfg(feature = "macros")))] #[cfg(feature = "macros")] -pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto}; +pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto, FromPyObject}; #[macro_use] mod macros; diff --git a/src/prelude.rs b/src/prelude.rs index 90e23992..7fd0cee8 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -10,6 +10,9 @@ //! use pyo3::prelude::*; //! ``` +pub use crate::conversion::{ + FromPyObject, IntoPy, IntoPyPointer, PyTryFrom, PyTryInto, ToPyObject, +}; pub use crate::err::{PyErr, PyResult}; pub use crate::gil::GILGuard; pub use crate::instance::{Py, PyObject}; @@ -18,7 +21,6 @@ pub use crate::pyclass_init::PyClassInitializer; pub use crate::python::Python; pub use crate::types::{PyAny, PyModule}; pub use crate::wrap_pyfunction; -pub use crate::{FromPyObject, IntoPy, IntoPyPointer, PyTryFrom, PyTryInto, ToPyObject}; #[cfg_attr(docsrs, doc(cfg(feature = "macros")))] #[cfg(feature = "macros")] diff --git a/tests/test_proc_macro_hygiene.rs b/tests/test_proc_macro_hygiene.rs index a24dd32a..840cd841 100644 --- a/tests/test_proc_macro_hygiene.rs +++ b/tests/test_proc_macro_hygiene.rs @@ -1,20 +1,20 @@ #![no_implicit_prelude] -#[derive(::pyo3::prelude::FromPyObject)] +#[derive(::pyo3::FromPyObject)] struct Derive1(i32); // newtype case -#[derive(::pyo3::prelude::FromPyObject)] +#[derive(::pyo3::FromPyObject)] #[allow(dead_code)] struct Derive2(i32, i32); // tuple case -#[derive(::pyo3::prelude::FromPyObject)] +#[derive(::pyo3::FromPyObject)] #[allow(dead_code)] struct Derive3 { f: i32, g: i32, } // struct case -#[derive(::pyo3::prelude::FromPyObject)] +#[derive(::pyo3::FromPyObject)] #[allow(dead_code)] enum Derive4 { A(i32), diff --git a/tests/ui/invalid_frompy_derive.rs b/tests/ui/invalid_frompy_derive.rs index ad21001f..bdbc9c4d 100644 --- a/tests/ui/invalid_frompy_derive.rs +++ b/tests/ui/invalid_frompy_derive.rs @@ -1,4 +1,4 @@ -use pyo3::prelude::FromPyObject; +use pyo3::FromPyObject; #[derive(FromPyObject)] struct Foo();