From d9532bdefce6ef7b04f932ed19c820ef8848cdb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gehrke?= <5106696+b-gehrke@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:29:57 +0200 Subject: [PATCH] Conditionally include typing information in rust --- src/model.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/model.rs b/src/model.rs index 4450f68..c65a92b 100644 --- a/src/model.rs +++ b/src/model.rs @@ -213,6 +213,7 @@ macro_rules! wrapped_base { }; } +#[cfg(pyi)] macro_rules! extensions_pyi { (ClassExpression, $v_name:ident) => { " @@ -447,7 +448,7 @@ macro_rules! wrapped_enum { } } - #[cfg(debug_assertions)] + #[cfg(pyi)] #[classmethod] fn __pyi__(_: &Bound<'_, PyType>) -> String { let mut res = String::new(); @@ -661,7 +662,7 @@ macro_rules! wrapped { } } - #[cfg(debug_assertions)] + #[cfg(pyi)] #[classmethod] fn __pyi__(_: &Bound<'_, PyType>) -> String { let mut res = String::new(); @@ -746,7 +747,7 @@ macro_rules! wrapped { ) } - #[cfg(debug_assertions)] + #[cfg(pyi)] #[classmethod] fn __pyi__(_: &Bound<'_, PyType>) -> String { let mut res = String::new(); @@ -815,7 +816,6 @@ macro_rules! wrapped { )* } - #[cfg(debug_assertions)] impl ToPyi for $name { #[allow(unused_assignments)] fn pyi(module: Option) -> String { @@ -1061,8 +1061,6 @@ for BTreeSet>> } } - -#[cfg(debug_assertions)] trait ToPyi { fn pyi(module: Option) -> String; } @@ -1227,9 +1225,9 @@ pub enum Facet { LangRange = 11, } -#[cfg(debug_assertions)] #[pymethods] impl Facet { + #[cfg(pyi)] #[classmethod] fn __pyi__(_: &Bound<'_, PyType>) -> String { "class Facet: