Upgrade to PyO3 0.17
This commit is contained in:
parent
68fa93de0c
commit
31d7ac3fc2
|
@ -17,7 +17,7 @@ crate-type = ["cdylib"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bincode = "1.3.1"
|
bincode = "1.3.1"
|
||||||
instant-distance = { version = "0.6", path = "../instant-distance", features = ["with-serde"] }
|
instant-distance = { version = "0.6", path = "../instant-distance", features = ["with-serde"] }
|
||||||
pyo3 = { version = "0.16", features = ["extension-module"] }
|
pyo3 = { version = "0.17.1", features = ["extension-module"] }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde-big-array = "0.4.1"
|
serde-big-array = "0.4.1"
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,15 @@ use std::iter::FromIterator;
|
||||||
use instant_distance::Point;
|
use instant_distance::Point;
|
||||||
use pyo3::conversion::IntoPy;
|
use pyo3::conversion::IntoPy;
|
||||||
use pyo3::exceptions::{PyTypeError, PyValueError};
|
use pyo3::exceptions::{PyTypeError, PyValueError};
|
||||||
use pyo3::proc_macro::{pyclass, pymethods, pymodule};
|
|
||||||
use pyo3::types::{PyList, PyModule, PyString};
|
use pyo3::types::{PyList, PyModule, PyString};
|
||||||
|
use pyo3::{pyclass, pymethods, pymodule};
|
||||||
use pyo3::{Py, PyAny, PyErr, PyObject, PyRef, PyRefMut, PyResult, Python};
|
use pyo3::{Py, PyAny, PyErr, PyObject, PyRef, PyRefMut, PyResult, Python};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_big_array::BigArray;
|
use serde_big_array::BigArray;
|
||||||
|
|
||||||
#[pymodule]
|
#[pymodule]
|
||||||
fn instant_distance(_: Python, m: &PyModule) -> PyResult<()> {
|
#[pyo3(name = "instant_distance")]
|
||||||
|
fn instant_distance_py(_: Python, m: &PyModule) -> PyResult<()> {
|
||||||
m.add_class::<Neighbor>()?;
|
m.add_class::<Neighbor>()?;
|
||||||
m.add_class::<Heuristic>()?;
|
m.add_class::<Heuristic>()?;
|
||||||
m.add_class::<Config>()?;
|
m.add_class::<Config>()?;
|
||||||
|
|
Loading…
Reference in New Issue