Skip to content

deps: update pyo3 to newest version#9

Open
theHamsta wants to merge 1 commit intorustnn:mainfrom
theHamsta:pyo3-update
Open

deps: update pyo3 to newest version#9
theHamsta wants to merge 1 commit intorustnn:mainfrom
theHamsta:pyo3-update

Conversation

@theHamsta
Copy link
Copy Markdown

@theHamsta theHamsta commented Mar 22, 2026

This allows using pywebnn with Python 3.14 without needing to set any environment variables that allow usage with unknown Python versions.

All our dependencies are not up-to-date at the moment.

I'm not familiar to the project so I don't know whether I broke anything. These tests are failing before and after the change.

FAILED tests/test_python_api.py::test_async_dispatch - Failed: async def functions are not natively supported.
FAILED tests/test_python_api.py::test_async_tensor_read_write - Failed: async def functions are not natively supported.
FAILED tests/test_python_api.py::test_async_concurrent_operations - Failed: async def functions are not natively supported.
FAILED tests/test_python_api.py::test_async_dispatch_with_actual_computation - Failed: async def functions are not natively supported.
FAILED tests/test_python_api.py::test_async_context_properties - Failed: async def functions are not natively supported.

EDIT: was just because of missing pytest-asyncio

#[pyclass(name = "MLDeviceTensor", skip_from_py_object)]
pub struct PyMLDeviceTensor {
pub(crate) handle: rustnn::tensor::DeviceTensorHandle,
destroyed: Arc<Mutex<bool>>,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

FromPyObject requires Clone. DeviceTensorHandle is not Clone at the moment. Would need to switch from Box<dyn backend> to Arc<dyn backend>

@theHamsta
Copy link
Copy Markdown
Author

theHamsta commented Mar 22, 2026

Async support https://pyo3.rs/v0.28.2/async-await

This allows using pywebnn with Python 3.14 without needing to set any
environment variables that allow usage with unknown Python versions.
@theHamsta
Copy link
Copy Markdown
Author

Seems that setuptools-rust is now recommended instead of the extension-module feature https://pyo3.rs/v0.28.2/features.html#extension-module

@theHamsta theHamsta mentioned this pull request Mar 22, 2026
@mtavenrath mtavenrath self-requested a review March 25, 2026 10:20
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