fix(python): remove the macro_export and use pub(crate) instead so that it doesn't leak into the documentations.

This commit is contained in:
cschen 2024-09-08 11:03:10 +02:00
parent 6afa212fe4
commit f116f27b39
3 changed files with 5 additions and 5 deletions

View file

@ -6,8 +6,8 @@ use crate::cursor::Controller as CursorController;
use pyo3::exceptions::PyValueError; use pyo3::exceptions::PyValueError;
use pyo3::prelude::*; use pyo3::prelude::*;
use super::a_sync_allow_threads;
use super::Promise; use super::Promise;
use crate::a_sync_allow_threads;
// need to do manually since Controller is a trait implementation // need to do manually since Controller is a trait implementation
#[pymethods] #[pymethods]

View file

@ -82,7 +82,6 @@ impl Promise {
} }
} }
#[macro_export]
macro_rules! a_sync { macro_rules! a_sync {
($x:expr) => {{ ($x:expr) => {{
Ok($crate::ffi::python::Promise(Some( Ok($crate::ffi::python::Promise(Some(
@ -91,8 +90,8 @@ macro_rules! a_sync {
))) )))
}}; }};
} }
pub(crate) use a_sync;
#[macro_export]
macro_rules! a_sync_allow_threads { macro_rules! a_sync_allow_threads {
($py:ident, $x:expr) => {{ ($py:ident, $x:expr) => {{
$py.allow_threads(move || { $py.allow_threads(move || {
@ -103,6 +102,7 @@ macro_rules! a_sync_allow_threads {
}) })
}}; }};
} }
pub(crate) use a_sync_allow_threads;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
struct LoggerProducer(mpsc::UnboundedSender<String>); struct LoggerProducer(mpsc::UnboundedSender<String>);
@ -197,7 +197,7 @@ fn set_logger(py: Python, logging_cb: PyObject, debug: bool) -> bool {
impl From<crate::errors::ConnectionError> for PyErr { impl From<crate::errors::ConnectionError> for PyErr {
fn from(value: crate::errors::ConnectionError) -> Self { fn from(value: crate::errors::ConnectionError) -> Self {
PyConnectionError::new_err(format!("Connection error: {value}")) PyConnectionError::new_err(format!("Connection error: {value}"))
} }
} }

View file

@ -3,8 +3,8 @@ use crate::cursor::Controller as CursorController;
use crate::workspace::Workspace; use crate::workspace::Workspace;
use pyo3::prelude::*; use pyo3::prelude::*;
use super::a_sync_allow_threads;
use super::Promise; use super::Promise;
use crate::a_sync_allow_threads;
#[pymethods] #[pymethods]
impl Workspace { impl Workspace {