Skip to content

Commit

Permalink
Conditionally include typing information in rust
Browse files Browse the repository at this point in the history
  • Loading branch information
b-gehrke committed Jun 19, 2024
1 parent 068d9d1 commit d9532bd
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ macro_rules! wrapped_base {
};
}

#[cfg(pyi)]
macro_rules! extensions_pyi {
(ClassExpression, $v_name:ident) => {
"
Expand Down Expand Up @@ -447,7 +448,7 @@ macro_rules! wrapped_enum {
}
}

#[cfg(debug_assertions)]
#[cfg(pyi)]
#[classmethod]
fn __pyi__(_: &Bound<'_, PyType>) -> String {
let mut res = String::new();
Expand Down Expand Up @@ -661,7 +662,7 @@ macro_rules! wrapped {
}
}

#[cfg(debug_assertions)]
#[cfg(pyi)]
#[classmethod]
fn __pyi__(_: &Bound<'_, PyType>) -> String {
let mut res = String::new();
Expand Down Expand Up @@ -746,7 +747,7 @@ macro_rules! wrapped {
)
}

#[cfg(debug_assertions)]
#[cfg(pyi)]
#[classmethod]
fn __pyi__(_: &Bound<'_, PyType>) -> String {
let mut res = String::new();
Expand Down Expand Up @@ -815,7 +816,6 @@ macro_rules! wrapped {
)*
}

#[cfg(debug_assertions)]
impl ToPyi for $name {
#[allow(unused_assignments)]
fn pyi(module: Option<String>) -> String {
Expand Down Expand Up @@ -1061,8 +1061,6 @@ for BTreeSet<horned_owl::model::Annotation<Arc<str>>>
}
}


#[cfg(debug_assertions)]
trait ToPyi {
fn pyi(module: Option<String>) -> String;
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d9532bd

Please sign in to comment.