Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix Python bindings to use async #2682

Merged
merged 18 commits into from
Feb 7, 2025

Conversation

b-zee
Copy link
Contributor

@b-zee b-zee commented Jan 30, 2025

The Python bindings are mostly constructing temporary async runtimes, but that doesn't work most of the times. This PR uses a special helper crate to aide in correctly using async Rust from Python.

@b-zee b-zee marked this pull request as ready for review February 3, 2025 15:46
@b-zee b-zee enabled auto-merge February 5, 2025 15:06
"/ip4/127.0.0.1/tcp/12001"
]
client = Client.connect(peers)
client = await Client.init()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is much nicer

})
}

#[staticmethod]
fn from_chunk_address(addr: &PyChunkAddress) -> Self {
Self {
inner: RustPointerTarget::ChunkAddress(addr.inner),
inner: PointerTarget::ChunkAddress(addr.inner),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on removing the rust name there. Much cleaner

@b-zee b-zee added this pull request to the merge queue Feb 7, 2025
Merged via the queue into maidsafe:main with commit 28ee918 Feb 7, 2025
25 checks passed
@b-zee b-zee deleted the refactor-python-bindings branch February 7, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants