Skip to content

Commit 33d8a8c

Browse files
committed
Upgrade to pyo3 0.3.1
1 parent 4855c7e commit 33d8a8c

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ license-file = "LICENSE"
1313
libc = "0.2"
1414
num-complex = "0.1"
1515
ndarray = "0.10"
16-
17-
[dependencies.pyo3]
18-
git = "https://github.com/PyO3/pyo3"
19-
rev = "4169b0317826dc62eafcdd0faab7d009f6808c06"
16+
pyo3 = "0.3.1"

example/extensions/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ version = "0.1.0"
44
authors = ["Toshiki Teramura <[email protected]>"]
55

66
[lib]
7-
name = "numpy_rust_ext"
7+
name = "rust_ext"
88
crate-type = ["cdylib"]
99

1010
[dependencies]
1111
numpy = { path = "../.." }
1212
ndarray = "0.10"
13-
14-
[dependencies.pyo3]
15-
git = "https://github.com/PyO3/pyo3.git"
16-
rev = "4169b0317826dc62eafcdd0faab7d009f6808c06"
17-
features = ["extension-module"]
13+
pyo3 = "0.3.1"

example/extensions/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
#![feature(proc_macro, specialization)]
1+
#![feature(use_extern_macros, specialization)]
22

33
extern crate ndarray;
44
extern crate numpy;
55
extern crate pyo3;
66

77
use ndarray::*;
88
use numpy::*;
9-
use pyo3::{py::modinit as pymodinit, PyModule, PyResult, Python};
9+
use pyo3::prelude::*;
1010

11-
#[pymodinit(_rust_ext)]
12-
fn init_module(py: Python, m: &PyModule) -> PyResult<()> {
11+
#[pymodinit]
12+
fn rust_ext(py: Python, m: &PyModule) -> PyResult<()> {
1313
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1414
// You **must** write this sentence for PyArray type checker working correctly
1515
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

example/rust_ext/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from numpy_rust_ext._rust_ext import *
1+
from .rust_ext import *

example/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def run(self):
2828
name='rust_ext',
2929
version='0.1.0',
3030
description='Example of python-extension using rust-numpy',
31-
rust_extensions=[RustExtension('numpy_rust_ext._rust_ext', 'extensions/Cargo.toml')],
31+
rust_extensions=[RustExtension('rust_ext.rust_ext', 'extensions/Cargo.toml')],
3232
install_requires=install_requires,
3333
setup_requires=setup_requires,
3434
test_requires=test_requires,

0 commit comments

Comments
 (0)