Skip to content

Commit

Permalink
build(binding/python): Support Python 3.13 (#5248)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zheaoli authored Oct 28, 2024
1 parent 08d3bf4 commit 3fe8caa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ futures = "0.3.28"
opendal = { version = ">=0", path = "../../core", features = [
"layers-blocking",
] }
pyo3 = { version = "0.21.2", features = ["abi3", "abi3-py311"] }
pyo3-asyncio = { package = "pyo3-asyncio-0-21", version = "0.21", features = [
pyo3 = { version = "0.22.5", features = ["abi3", "abi3-py311"] }
pyo3-async-runtimes = { version = "0.22.0", features = [
"tokio-runtime",
] }
tokio = "1"
Expand Down
4 changes: 1 addition & 3 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ description = "Apache OpenDAL™ Python Binding"
license = { text = "Apache-2.0" }
name = "opendal"
readme = "README.md"
# PyO3 doesn't support python 3.13 yet.
# ref: https://github.com/apache/opendal/issues/4268
requires-python = ">=3.11, < 3.13"
requires-python = ">=3.11"

[project.optional-dependencies]
benchmark = [
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use pyo3::buffer::PyBuffer;
use pyo3::exceptions::PyIOError;
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use pyo3_asyncio::tokio::future_into_py;
use pyo3_async_runtimes::tokio::future_into_py;
use tokio::sync::Mutex;

use crate::*;
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::sync::Arc;
use futures::TryStreamExt;
use pyo3::exceptions::PyStopAsyncIteration;
use pyo3::prelude::*;
use pyo3_asyncio::tokio::future_into_py;
use pyo3_async_runtimes::tokio::future_into_py;
use tokio::sync::Mutex;

use crate::*;
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::time::Duration;
use pyo3::prelude::*;
use pyo3::types::PyBytes;
use pyo3::types::PyDict;
use pyo3_asyncio::tokio::future_into_py;
use pyo3_async_runtimes::tokio::future_into_py;

use crate::*;

Expand All @@ -32,7 +32,7 @@ fn build_operator(
) -> PyResult<ocore::Operator> {
let mut op = ocore::Operator::via_iter(scheme, map).map_err(format_pyerr)?;
if !op.info().full_capability().blocking {
let runtime = pyo3_asyncio::tokio::get_runtime();
let runtime = pyo3_async_runtimes::tokio::get_runtime();
let _guard = runtime.enter();
op = op
.layer(ocore::layers::BlockingLayer::create().expect("blocking layer must be created"));
Expand Down

0 comments on commit 3fe8caa

Please sign in to comment.