File tree Expand file tree Collapse file tree 3 files changed +6
-38
lines changed
Expand file tree Collapse file tree 3 files changed +6
-38
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ Supported python version
3030-------------
3131Currently 2.7, 3.5, 3.6, 3.7 are supported.
3232
33- By default, python version is automatically by execute ` python ` .
33+ By default, rust-numpy is built for Python3 .
3434
35- You cal also specify python version manually, by adding a feature flag like
35+ If you want to compile for Python2, please specify
3636
3737``` toml
3838[dependencies .numpy ]
@@ -41,7 +41,8 @@ features = ["python3"]
4141```
4242.
4343
44- You can also specify python version in [ setup.py] ( examples/simple-extension/setup.py ) .
44+ You can also automatically specify python version in [ setup.py] ( examples/simple-extension/setup.py )
45+ , using [ setuptools-rust] ( https://github.com/PyO3/setuptools-rust ) .
4546
4647
4748Example
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ use std::os::raw::c_void;
1616fn get_numpy_api ( module : & str , capsule : & str ) -> * const * const c_void {
1717 let module = CString :: new ( module) . unwrap ( ) ;
1818 let capsule = CString :: new ( capsule) . unwrap ( ) ;
19- #[ cfg( not ( Py_3 ) ) ]
19+ #[ cfg( feature = "python2" ) ]
2020 unsafe fn get_capsule ( capsule : * mut ffi:: PyObject ) -> * const * const c_void {
2121 ffi:: PyCObject_AsVoidPtr ( capsule) as * const * const c_void
2222 }
23- #[ cfg( Py_3 ) ]
23+ #[ cfg( not ( feature = "python2" ) ) ]
2424 unsafe fn get_capsule ( capsule : * mut ffi:: PyObject ) -> * const * const c_void {
2525 use std:: ptr:: null_mut;
2626 ffi:: PyCapsule_GetPointer ( capsule, null_mut ( ) ) as * const * const c_void
You can’t perform that action at this time.
0 commit comments