Skip to content

Commit 8de3443

Browse files
authored
Merge pull request #96 from kngwyu/release0.6
Update PyO3 to 0.7 and release 0.6
2 parents 6aa50ed + 9dfbf2c commit 8de3443

File tree

8 files changed

+13
-24
lines changed

8 files changed

+13
-24
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ cache:
99

1010
matrix:
1111
include:
12-
- python: "2.7"
13-
env: FEATURES=python2
1412
- python: "3.5"
1513
env: FEATURES=python3
1614
- python: "3.6"

Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "numpy"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = ["Toshiki Teramura <[email protected]>", "Yuji Kanagawa <[email protected]>"]
55
description = "Rust binding of NumPy C-API"
66
documentation = "https://rust-numpy.github.io/rust-numpy/numpy"
@@ -14,13 +14,11 @@ libc = "0.2"
1414
num-complex = "0.2"
1515
num-traits = "0.2"
1616
ndarray = "0.12"
17-
pyo3 = "0.6"
17+
pyo3 = "0.7"
1818

1919
[features]
2020
# In default setting, python version is automatically detected
2121
default = []
22-
# Use this feature when building python2 binding.
23-
python2 = ["pyo3/python2"]
24-
# Use this feature when building python3 binding.
22+
# This is no longer needed but setuptools-rust assumes this feature
2523
python3 = ["pyo3/python3"]
2624

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ using [setuptools-rust](https://github.com/PyO3/setuptools-rust).
5656
name = "numpy-test"
5757

5858
[dependencies]
59-
pyo3 = "0.6.0"
60-
numpy = "0.5.0"
59+
pyo3 = "0.7"
60+
numpy = "0.6.0"
6161
```
6262

6363
``` rust
@@ -100,11 +100,11 @@ name = "rust_ext"
100100
crate-type = ["cdylib"]
101101

102102
[dependencies]
103-
numpy = "0.5.0"
103+
numpy = "0.6.0"
104104
ndarray = "0.12"
105105

106106
[dependencies.pyo3]
107-
version = "0.6.0"
107+
version = "0.7"
108108
features = ["extension-module"]
109109
```
110110

@@ -160,6 +160,10 @@ We need your feedback.
160160
Don't hesitate to open [issues](https://github.com/rust-numpy/rust-numpy/issues)!
161161

162162
## Version
163+
- v0.6.0
164+
- Update PyO3 to 0.7
165+
- Drop Python2 support
166+
163167
- v0.5.0
164168
- Update PyO3 to 0.6
165169

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
environment:
22
TARGET: x86_64-pc-windows-msvc
33
matrix:
4-
- PYTHON: "C:/Python27-x64"
5-
FEATURES: python2
64
- PYTHON: "C:/Python35-x64"
75
FEATURES: python3
86
- PYTHON: "C:/Python36-x64"

examples/linalg/setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
rust_extensions=[RustExtension(
1717
'rust_linalg.rust_linalg',
1818
'./Cargo.toml',
19-
rustc_flags=['--cfg=Py_{}'.format(PYTHON_MAJOR_VERSION)],
20-
features=['numpy/python{}'.format(PYTHON_MAJOR_VERSION)],
2119
)],
2220
install_requires=install_requires,
2321
setup_requires=setup_requires,

examples/simple-extension/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ numpy = { path = "../.." }
1212
ndarray = "0.12"
1313

1414
[dependencies.pyo3]
15-
version = "0.6"
15+
version = "0.7"
1616
features = ["extension-module"]

examples/simple-extension/setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
rust_extensions=[RustExtension(
1717
'rust_ext.rust_ext',
1818
'./Cargo.toml',
19-
rustc_flags=['--cfg=Py_{}'.format(PYTHON_MAJOR_VERSION)],
20-
features=['numpy/python{}'.format(PYTHON_MAJOR_VERSION)],
2119
)],
2220
install_requires=install_requires,
2321
setup_requires=setup_requires,

src/npyffi/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,12 @@
1212
use pyo3::ffi;
1313
use std::ffi::CString;
1414
use std::os::raw::c_void;
15+
use std::ptr::null_mut;
1516

1617
fn get_numpy_api(module: &str, capsule: &str) -> *const *const c_void {
1718
let module = CString::new(module).unwrap();
1819
let capsule = CString::new(capsule).unwrap();
19-
#[cfg(feature = "python2")]
2020
unsafe fn get_capsule(capsule: *mut ffi::PyObject) -> *const *const c_void {
21-
ffi::PyCObject_AsVoidPtr(capsule) as *const *const c_void
22-
}
23-
#[cfg(not(feature = "python2"))]
24-
unsafe fn get_capsule(capsule: *mut ffi::PyObject) -> *const *const c_void {
25-
use std::ptr::null_mut;
2621
ffi::PyCapsule_GetPointer(capsule, null_mut()) as *const *const c_void
2722
}
2823
unsafe {

0 commit comments

Comments
 (0)