@@ -150,21 +150,18 @@ pub use crate::type_object::{type_flags, PyTypeInfo};
150150// Since PyAny is as important as PyObject, we expose it to the top level.
151151pub use crate :: types:: PyAny ;
152152
153- // Re-exported for wrap_function
153+ # [ cfg ( feature = "macros" ) ]
154154#[ doc( hidden) ]
155- pub use paste ;
156- // Re-exported for py_run
157- # [ doc ( hidden ) ]
158- pub use indoc ;
159- // Re-exported for pymethods
160- # [ doc ( hidden ) ]
161- pub use inventory ;
155+ pub use {
156+ indoc , // Re-exported for py_run
157+ inventory , // Re-exported for pymethods
158+ paste , // Re-exported for wrap_function
159+ unindent , // Re-exported for py_run
160+ } ;
161+
162162// Re-exported for the `__wrap` functions
163163#[ doc( hidden) ]
164164pub use libc;
165- // Re-exported for py_run
166- #[ doc( hidden) ]
167- pub use unindent;
168165
169166pub mod buffer;
170167#[ doc( hidden) ]
@@ -197,6 +194,7 @@ pub mod type_object;
197194pub mod types;
198195
199196/// The proc macros, which are also part of the prelude.
197+ #[ cfg( feature = "macros" ) ]
200198pub mod proc_macro {
201199 pub use pyo3cls:: pymodule;
202200 /// The proc macro attributes
@@ -278,6 +276,7 @@ macro_rules! wrap_pymodule {
278276/// If you need to handle failures, please use [Python::run] directly.
279277///
280278#[ macro_export]
279+ #[ cfg( feature = "macros" ) ]
281280macro_rules! py_run {
282281 ( $py: expr, $( $val: ident) +, $code: literal) => { {
283282 pyo3:: py_run_impl!( $py, $( $val) +, pyo3:: indoc:: indoc!( $code) )
@@ -289,6 +288,7 @@ macro_rules! py_run {
289288
290289#[ macro_export]
291290#[ doc( hidden) ]
291+ #[ cfg( feature = "macros" ) ]
292292macro_rules! py_run_impl {
293293 ( $py: expr, $( $val: ident) +, $code: expr) => { {
294294 use pyo3:: types:: IntoPyDict ;
0 commit comments