You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/12/14 14:40:43 UTC
(incubator-opendal) branch main updated: chore(bindings/python): upgrade pyo3 to 0.20 (#3758)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/main by this push:
new d82791c63 chore(bindings/python): upgrade pyo3 to 0.20 (#3758)
d82791c63 is described below
commit d82791c63a9788cab6158ceb06d00edace95ae21
Author: messense <me...@icloud.com>
AuthorDate: Thu Dec 14 22:40:39 2023 +0800
chore(bindings/python): upgrade pyo3 to 0.20 (#3758)
---
Cargo.lock | 37 +++++++++++++++++++------------------
bindings/python/Cargo.toml | 4 ++--
bindings/python/src/operator.rs | 10 +++++-----
bindings/python/src/utils.rs | 1 -
4 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index a43849e2d..ae28ff159 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3399,9 +3399,9 @@ checksum = "c40411d0e5c63ef1323c3d09ce5ec6d84d71531e18daed0743fccea279d7deb6"
[[package]]
name = "indoc"
-version = "1.0.9"
+version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306"
+checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
[[package]]
name = "infer"
@@ -5787,9 +5787,9 @@ dependencies = [
[[package]]
name = "pyo3"
-version = "0.19.2"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e681a6cfdc4adcc93b4d3cf993749a4552018ee0a9b65fc0ccfad74352c72a38"
+checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b"
dependencies = [
"cfg-if",
"indoc",
@@ -5804,9 +5804,9 @@ dependencies = [
[[package]]
name = "pyo3-asyncio"
-version = "0.19.0"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2cc34c1f907ca090d7add03dc523acdd91f3a4dab12286604951e2f5152edad"
+checksum = "6ea6b68e93db3622f3bb3bf363246cf948ed5375afe7abff98ccbdd50b184995"
dependencies = [
"futures",
"once_cell",
@@ -5817,9 +5817,9 @@ dependencies = [
[[package]]
name = "pyo3-build-config"
-version = "0.19.2"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "076c73d0bc438f7a4ef6fdd0c3bb4732149136abd952b110ac93e4edb13a6ba5"
+checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5"
dependencies = [
"once_cell",
"target-lexicon",
@@ -5827,9 +5827,9 @@ dependencies = [
[[package]]
name = "pyo3-ffi"
-version = "0.19.2"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e53cee42e77ebe256066ba8aa77eff722b3bb91f3419177cf4cd0f304d3284d9"
+checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b"
dependencies = [
"libc",
"pyo3-build-config",
@@ -5837,25 +5837,26 @@ dependencies = [
[[package]]
name = "pyo3-macros"
-version = "0.19.2"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfeb4c99597e136528c6dd7d5e3de5434d1ceaf487436a3f03b2d56b6fc9efd1"
+checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
"quote",
- "syn 1.0.109",
+ "syn 2.0.39",
]
[[package]]
name = "pyo3-macros-backend"
-version = "0.19.2"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "947dc12175c254889edc0c02e399476c2f652b4b9ebd123aa655c224de259536"
+checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424"
dependencies = [
+ "heck",
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.39",
]
[[package]]
@@ -8011,9 +8012,9 @@ checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
[[package]]
name = "unindent"
-version = "0.1.11"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c"
+checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
[[package]]
name = "unsigned-varint"
diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml
index 81156c355..beea4e11a 100644
--- a/bindings/python/Cargo.toml
+++ b/bindings/python/Cargo.toml
@@ -145,6 +145,6 @@ doc = false
[dependencies]
futures = "0.3.28"
opendal.workspace = true
-pyo3 = "0.19"
-pyo3-asyncio = { version = "0.19", features = ["tokio-runtime"] }
+pyo3 = "0.20"
+pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] }
tokio = "1"
diff --git a/bindings/python/src/operator.rs b/bindings/python/src/operator.rs
index c8057deac..9c7dfba13 100644
--- a/bindings/python/src/operator.rs
+++ b/bindings/python/src/operator.rs
@@ -494,35 +494,35 @@ pub(crate) fn build_opwrite(kwargs: Option<&PyDict>) -> PyResult<ocore::raw::OpW
return Ok(op);
};
- if let Some(append) = dict.get_item("append") {
+ if let Some(append) = dict.get_item("append")? {
let v = append
.extract::<bool>()
.map_err(|err| PyValueError::new_err(format!("append must be bool, got {}", err)))?;
op = op.with_append(v);
}
- if let Some(buffer) = dict.get_item("buffer") {
+ if let Some(buffer) = dict.get_item("buffer")? {
let v = buffer
.extract::<usize>()
.map_err(|err| PyValueError::new_err(format!("buffer must be usize, got {}", err)))?;
op = op.with_buffer(v);
}
- if let Some(content_type) = dict.get_item("content_type") {
+ if let Some(content_type) = dict.get_item("content_type")? {
let v = content_type.extract::<String>().map_err(|err| {
PyValueError::new_err(format!("content_type must be str, got {}", err))
})?;
op = op.with_content_type(v.as_str());
}
- if let Some(content_disposition) = dict.get_item("content_disposition") {
+ if let Some(content_disposition) = dict.get_item("content_disposition")? {
let v = content_disposition.extract::<String>().map_err(|err| {
PyValueError::new_err(format!("content_disposition must be str, got {}", err))
})?;
op = op.with_content_disposition(v.as_str());
}
- if let Some(cache_control) = dict.get_item("cache_control") {
+ if let Some(cache_control) = dict.get_item("cache_control")? {
let v = cache_control.extract::<String>().map_err(|err| {
PyValueError::new_err(format!("cache_control must be str, got {}", err))
})?;
diff --git a/bindings/python/src/utils.rs b/bindings/python/src/utils.rs
index df3a41aaa..619743066 100644
--- a/bindings/python/src/utils.rs
+++ b/bindings/python/src/utils.rs
@@ -19,7 +19,6 @@ use std::os::raw::c_int;
use pyo3::ffi;
use pyo3::prelude::*;
-use pyo3::AsPyPointer;
/// A bytes-like object that implements buffer protocol.
#[pyclass(module = "opendal")]