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
30
30
-------------
31
31
Currently 2.7, 3.5, 3.6, 3.7 are supported.
32
32
33
- By default, python version is automatically by execute ` python ` .
33
+ By default, rust-numpy is built for Python3 .
34
34
35
- You cal also specify python version manually, by adding a feature flag like
35
+ If you want to compile for Python2, please specify
36
36
37
37
``` toml
38
38
[dependencies .numpy ]
@@ -41,7 +41,8 @@ features = ["python3"]
41
41
```
42
42
.
43
43
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 ) .
45
46
46
47
47
48
Example
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;
16
16
fn get_numpy_api ( module : & str , capsule : & str ) -> * const * const c_void {
17
17
let module = CString :: new ( module) . unwrap ( ) ;
18
18
let capsule = CString :: new ( capsule) . unwrap ( ) ;
19
- #[ cfg( not ( Py_3 ) ) ]
19
+ #[ cfg( feature = "python2" ) ]
20
20
unsafe fn get_capsule ( capsule : * mut ffi:: PyObject ) -> * const * const c_void {
21
21
ffi:: PyCObject_AsVoidPtr ( capsule) as * const * const c_void
22
22
}
23
- #[ cfg( Py_3 ) ]
23
+ #[ cfg( not ( feature = "python2" ) ) ]
24
24
unsafe fn get_capsule ( capsule : * mut ffi:: PyObject ) -> * const * const c_void {
25
25
use std:: ptr:: null_mut;
26
26
ffi:: PyCapsule_GetPointer ( capsule, null_mut ( ) ) as * const * const c_void
You can’t perform that action at this time.
0 commit comments