This is an automated email from the ASF dual-hosted git repository.
asukaminato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new c6e8963a3 chore(deps): bump the pyo3 group in /bindings/python with 2
updates (#6631)
c6e8963a3 is described below
commit c6e8963a3d356ccb9d0326f146bea62bd901f223
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Oct 8 17:40:05 2025 +0900
chore(deps): bump the pyo3 group in /bindings/python with 2 updates (#6631)
* chore(deps): bump the pyo3 group in /bindings/python with 2 updates
Updates the requirements on [pyo3](https://github.com/pyo3/pyo3) and
[pyo3-async-runtimes](https://github.com/PyO3/pyo3-async-runtimes) to permit
the latest version.
Updates `pyo3` to 0.25.1
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.25.1...v0.25.1)
Updates `pyo3-async-runtimes` to 0.26.0
- [Release notes](https://github.com/PyO3/pyo3-async-runtimes/releases)
-
[Changelog](https://github.com/PyO3/pyo3-async-runtimes/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/PyO3/pyo3-async-runtimes/compare/v0.25.0...v0.26.0)
---
updated-dependencies:
- dependency-name: pyo3
dependency-version: 0.25.1
dependency-type: direct:production
dependency-group: pyo3
- dependency-name: pyo3-async-runtimes
dependency-version: 0.26.0
dependency-type: direct:production
dependency-group: pyo3
...
Signed-off-by: dependabot[bot] <[email protected]>
* fix clippy
---------
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot]
<49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Asuka Minato <[email protected]>
---
bindings/python/Cargo.toml | 4 ++--
bindings/python/src/file.rs | 10 +++++-----
bindings/python/src/lister.rs | 6 +++---
bindings/python/src/operator.rs | 8 ++++----
bindings/python/src/utils.rs | 2 +-
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml
index 91fd47710..a725216a4 100644
--- a/bindings/python/Cargo.toml
+++ b/bindings/python/Cargo.toml
@@ -166,8 +166,8 @@ opendal = { version = ">=0", path = "../../core", features
= [
"blocking",
"layers-mime-guess"
] }
-pyo3 = { version = "0.25.1", features = ["generate-import-lib", "chrono"] }
-pyo3-async-runtimes = { version = "0.25.0", features = ["tokio-runtime"] }
+pyo3 = { version = "0.26.0", features = ["generate-import-lib", "chrono"] }
+pyo3-async-runtimes = { version = "0.26.0", features = ["tokio-runtime"] }
tokio = "1"
[target.'cfg(unix)'.dependencies.opendal]
diff --git a/bindings/python/src/file.rs b/bindings/python/src/file.rs
index 10aa24d80..3306f5eed 100644
--- a/bindings/python/src/file.rs
+++ b/bindings/python/src/file.rs
@@ -170,7 +170,7 @@ impl File {
return Err(PyIOError::new_err("Buffer is not C contiguous."));
}
- Python::with_gil(|_py| {
+ Python::attach(|_py| {
let ptr = buffer.buf_ptr();
let nbytes = buffer.len_bytes();
unsafe {
@@ -280,9 +280,9 @@ impl File {
pub fn __exit__(
&mut self,
- _exc_type: PyObject,
- _exc_value: PyObject,
- _traceback: PyObject,
+ _exc_type: Py<PyAny>,
+ _exc_value: Py<PyAny>,
+ _traceback: Py<PyAny>,
) -> PyResult<()> {
self.close()
}
@@ -393,7 +393,7 @@ impl AsyncFile {
}
};
- Python::with_gil(|py| Buffer::new(buffer).into_bytes(py))
+ Python::attach(|py| Buffer::new(buffer).into_bytes(py))
})
}
diff --git a/bindings/python/src/lister.rs b/bindings/python/src/lister.rs
index 1af624f6f..352afd11d 100644
--- a/bindings/python/src/lister.rs
+++ b/bindings/python/src/lister.rs
@@ -40,7 +40,7 @@ impl BlockingLister {
fn __iter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
slf
}
- fn __next__(mut slf: PyRefMut<'_, Self>) -> PyResult<Option<PyObject>> {
+ fn __next__(mut slf: PyRefMut<'_, Self>) -> PyResult<Option<Py<PyAny>>> {
match slf.0.next() {
Some(Ok(entry)) =>
Ok(Some(Entry::new(entry).into_py_any(slf.py())?)),
Some(Err(err)) => {
@@ -66,13 +66,13 @@ impl AsyncLister {
fn __aiter__(slf: PyRef<'_, Self>) -> PyRef<'_, Self> {
slf
}
- fn __anext__(slf: PyRefMut<'_, Self>) -> PyResult<Option<PyObject>> {
+ fn __anext__(slf: PyRefMut<'_, Self>) -> PyResult<Option<Py<PyAny>>> {
let lister = slf.0.clone();
let fut = future_into_py(slf.py(), async move {
let mut lister = lister.lock().await;
let entry = lister.try_next().await.map_err(format_pyerr)?;
match entry {
- Some(entry) => Python::with_gil(|py| {
+ Some(entry) => Python::attach(|py| {
let py_obj = Entry::new(entry).into_py_any(py)?;
Ok(Some(py_obj))
}),
diff --git a/bindings/python/src/operator.rs b/bindings/python/src/operator.rs
index 0c00d2e92..854a9c440 100644
--- a/bindings/python/src/operator.rs
+++ b/bindings/python/src/operator.rs
@@ -307,7 +307,7 @@ impl Operator {
}
}
- fn __getnewargs_ex__(&self, py: Python) -> PyResult<PyObject> {
+ fn __getnewargs_ex__(&self, py: Python) -> PyResult<Py<PyAny>> {
let args = vec![self.__scheme.to_string()];
let args = PyTuple::new(py, args)?.into_py_any(py)?;
let kwargs = self.__map.clone().into_py_any(py)?;
@@ -431,7 +431,7 @@ impl AsyncOperator {
.await
.map_err(format_pyerr)?
.to_vec();
- Python::with_gil(|py| Buffer::new(res).into_bytes(py))
+ Python::attach(|py| Buffer::new(res).into_bytes(py))
})
}
@@ -611,7 +611,7 @@ impl AsyncOperator {
.lister_options(&path, kwargs.into())
.await
.map_err(format_pyerr)?;
- let pylister = Python::with_gil(|py|
AsyncLister::new(lister).into_py_any(py))?;
+ let pylister = Python::attach(|py|
AsyncLister::new(lister).into_py_any(py))?;
Ok(pylister)
})
@@ -748,7 +748,7 @@ impl AsyncOperator {
}
}
- fn __getnewargs_ex__(&self, py: Python) -> PyResult<PyObject> {
+ fn __getnewargs_ex__(&self, py: Python) -> PyResult<Py<PyAny>> {
let args = vec![self.__scheme.to_string()];
let args = PyTuple::new(py, args)?.into_py_any(py)?;
let kwargs = self.__map.clone().into_py_any(py)?;
diff --git a/bindings/python/src/utils.rs b/bindings/python/src/utils.rs
index 9970b3304..40c36e219 100644
--- a/bindings/python/src/utils.rs
+++ b/bindings/python/src/utils.rs
@@ -36,7 +36,7 @@ impl Buffer {
pub fn into_bytes(self, py: Python) -> PyResult<Py<PyAny>> {
let buffer = self.into_py_any(py)?;
- unsafe { PyObject::from_owned_ptr_or_err(py,
ffi::PyBytes_FromObject(buffer.as_ptr())) }
+ unsafe { Py::<PyAny>::from_owned_ptr_or_err(py,
ffi::PyBytes_FromObject(buffer.as_ptr())) }
}
/// Consume self to build a bytes