File tree Expand file tree Collapse file tree 8 files changed +13
-24
lines changed Expand file tree Collapse file tree 8 files changed +13
-24
lines changed Original file line number Diff line number Diff line change 99
1010matrix :
1111 include :
12- - python : " 2.7"
13- env : FEATURES=python2
1412 - python : " 3.5"
1513 env : FEATURES=python3
1614 - python : " 3.6"
Original file line number Diff line number Diff line change 11[package ]
22name = " numpy"
3- version = " 0.5 .0"
3+ version = " 0.6 .0"
44authors = [" Toshiki Teramura <toshiki.teramura@gmail.com>" , " Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>" ]
55description = " Rust binding of NumPy C-API"
66documentation = " https://rust-numpy.github.io/rust-numpy/numpy"
@@ -14,13 +14,11 @@ libc = "0.2"
1414num-complex = " 0.2"
1515num-traits = " 0.2"
1616ndarray = " 0.12"
17- pyo3 = " 0.6 "
17+ pyo3 = " 0.7 "
1818
1919[features ]
2020# In default setting, python version is automatically detected
2121default = []
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
2523python3 = [" pyo3/python3" ]
2624
Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ using [setuptools-rust](https://github.com/PyO3/setuptools-rust).
5656name = " 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"
100100crate-type = [" cdylib" ]
101101
102102[dependencies ]
103- numpy = " 0.5 .0"
103+ numpy = " 0.6 .0"
104104ndarray = " 0.12"
105105
106106[dependencies .pyo3 ]
107- version = " 0.6.0 "
107+ version = " 0.7 "
108108features = [" extension-module" ]
109109```
110110
@@ -160,6 +160,10 @@ We need your feedback.
160160Don'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
Original file line number Diff line number Diff line change 11environment :
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"
Original file line number Diff line number Diff line change 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 ,
Original file line number Diff line number Diff line change @@ -12,5 +12,5 @@ numpy = { path = "../.." }
1212ndarray = " 0.12"
1313
1414[dependencies .pyo3 ]
15- version = " 0.6 "
15+ version = " 0.7 "
1616features = [" extension-module" ]
Original file line number Diff line number Diff line change 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 ,
Original file line number Diff line number Diff line change 1212use pyo3:: ffi;
1313use std:: ffi:: CString ;
1414use std:: os:: raw:: c_void;
15+ use std:: ptr:: null_mut;
1516
1617fn 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 {
You can’t perform that action at this time.
0 commit comments