bump pyo3 to 0.16

This commit is contained in:
Richard Patel 2022-04-07 05:42:55 +02:00
parent e667999a3d
commit d845d6c067
3 changed files with 38 additions and 76 deletions

96
Cargo.lock generated
View File

@ -135,24 +135,10 @@ dependencies = [
[[package]] [[package]]
name = "indoc" name = "indoc"
version = "0.3.6" version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47741a8bc60fb26eb8d6e0238bbb26d8575ff623fdc97b1a2c00c050b9684ed8" checksum = "e7906a9fababaeacb774f72410e497a1d18de916322e33797bb2cd29baa23c9e"
dependencies = [ dependencies = [
"indoc-impl",
"proc-macro-hack",
]
[[package]]
name = "indoc-impl"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce046d161f000fffde5f432a0d034d0341dc152643b2598ed5bfce44c4f3a8f0"
dependencies = [
"proc-macro-hack",
"proc-macro2",
"quote",
"syn",
"unindent", "unindent",
] ]
@ -167,24 +153,12 @@ dependencies = [
[[package]] [[package]]
name = "inventory" name = "inventory"
version = "0.1.11" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0eb5160c60ba1e809707918ee329adb99d222888155835c6feedba19f6c3fd4" checksum = "ce6b5d8c669bfbad811d95ddd7a1c6cf9cfdbf2777e59928b6f3fa8ff54f72a0"
dependencies = [ dependencies = [
"ctor", "ctor",
"ghost", "ghost",
"inventory-impl",
]
[[package]]
name = "inventory-impl"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e41b53715c6f0c4be49510bb82dee2c1e51c8586d885abe65396e82ed518548"
dependencies = [
"proc-macro2",
"quote",
"syn",
] ]
[[package]] [[package]]
@ -292,25 +266,6 @@ dependencies = [
"num-traits", "num-traits",
] ]
[[package]]
name = "paste"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880"
dependencies = [
"paste-impl",
"proc-macro-hack",
]
[[package]]
name = "paste-impl"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
dependencies = [
"proc-macro-hack",
]
[[package]] [[package]]
name = "petgraph" name = "petgraph"
version = "0.6.0" version = "0.6.0"
@ -384,12 +339,6 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
[[package]]
name = "proc-macro-hack"
version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.37" version = "1.0.37"
@ -401,36 +350,48 @@ dependencies = [
[[package]] [[package]]
name = "pyo3" name = "pyo3"
version = "0.14.5" version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35100f9347670a566a67aa623369293703322bb9db77d99d7df7313b575ae0c8" checksum = "6b3e99c4c3e790e4fc365b42b70c1f7801f42eadc4ea648fa327e6f5ca29f215"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"indoc", "indoc",
"inventory", "inventory",
"libc", "libc",
"parking_lot", "parking_lot",
"paste",
"pyo3-build-config", "pyo3-build-config",
"pyo3-ffi",
"pyo3-macros", "pyo3-macros",
"unindent", "unindent",
] ]
[[package]] [[package]]
name = "pyo3-build-config" name = "pyo3-build-config"
version = "0.14.5" version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d12961738cacbd7f91b7c43bc25cfeeaa2698ad07a04b3be0aa88b950865738f" checksum = "2486b96281859ff0a3929ba6467b13751627b974f7137362db38e2bed14b2094"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"target-lexicon",
]
[[package]]
name = "pyo3-ffi"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd9de1d94557751599f8bd321f10e6c1ef2801067acb58c91138deef2ae83a17"
dependencies = [
"libc",
"pyo3-build-config",
] ]
[[package]] [[package]]
name = "pyo3-macros" name = "pyo3-macros"
version = "0.14.5" version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0bc5215d704824dfddddc03f93cb572e1155c68b6761c37005e1c288808ea8" checksum = "0b9584049129b1cfb615243391a6345c726690271ae195ffd6aa3766177296aa"
dependencies = [ dependencies = [
"proc-macro2",
"pyo3-macros-backend", "pyo3-macros-backend",
"quote", "quote",
"syn", "syn",
@ -438,12 +399,11 @@ dependencies = [
[[package]] [[package]]
name = "pyo3-macros-backend" name = "pyo3-macros-backend"
version = "0.14.5" version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71623fc593224afaab918aa3afcaf86ed2f43d34f6afde7f3922608f253240df" checksum = "b6c4717e6a55c51a9958eda1f5481ff7f62cccd21f45309c10e4731cb7198dbc"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"pyo3-build-config",
"quote", "quote",
"syn", "syn",
] ]
@ -573,6 +533,12 @@ dependencies = [
"unicode-xid", "unicode-xid",
] ]
[[package]]
name = "target-lexicon"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1"
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.3" version = "1.1.3"

View File

@ -16,5 +16,5 @@ extension-module = ["pyo3/extension-module"]
default = ["extension-module"] default = ["extension-module"]
[dependencies] [dependencies]
pyo3 = { version = "0.14", features = ["multiple-pymethods"] } pyo3 = { version = "0.16", features = ["multiple-pymethods"] }
ppc750cl = { version = "0.1.1", path = "../disasm" } ppc750cl = { version = "0.1.1", path = "../disasm" }

View File

@ -1,6 +1,5 @@
use pyo3::prelude::*; use pyo3::prelude::*;
use pyo3::types::PyBytes; use pyo3::types::PyBytes;
use pyo3::{PyIterProtocol, PyObjectProtocol};
use ppc750cl::formatter::FormattedIns; use ppc750cl::formatter::FormattedIns;
@ -23,6 +22,10 @@ impl Ins {
fn addr(&self) -> PyResult<u32> { fn addr(&self) -> PyResult<u32> {
Ok(self.0.addr) Ok(self.0.addr)
} }
fn __str__(&self) -> String {
FormattedIns(self.0.clone()).to_string()
}
} }
impl From<ppc750cl::Ins> for Ins { impl From<ppc750cl::Ins> for Ins {
@ -31,13 +34,6 @@ impl From<ppc750cl::Ins> for Ins {
} }
} }
#[pyproto]
impl<'a> PyObjectProtocol<'a> for Ins {
fn __str__(&self) -> String {
FormattedIns(self.0.clone()).to_string()
}
}
#[pyclass] #[pyclass]
struct DisasmIterator { struct DisasmIterator {
bytes: Py<PyBytes>, bytes: Py<PyBytes>,
@ -46,8 +42,8 @@ struct DisasmIterator {
left: usize, left: usize,
} }
#[pyproto] #[pymethods]
impl PyIterProtocol for DisasmIterator { impl DisasmIterator {
fn __iter__(slf: PyRef<Self>) -> PyRef<DisasmIterator> { fn __iter__(slf: PyRef<Self>) -> PyRef<DisasmIterator> {
slf slf
} }