update travis config

This commit is contained in:
Nikolay Kim 2017-05-12 22:51:14 -07:00
parent e40ef289e0
commit bf4e36d9d9
2 changed files with 8 additions and 8 deletions

View File

@ -11,12 +11,9 @@ NIGHTLY := 0
endif
endif
ifeq ($(PY),3)
FEATURES := python3-sys
ifdef PEP384
export PEP384=1
FEATURES := $(FEATURES) pep-384
endif
FEATURES := pep-384
endif
ifeq ($(NIGHTLY),1)
FEATURES := $(FEATURES) nightly
@ -24,7 +21,7 @@ endif
CARGO_FLAGS := --features "$(FEATURES)" --no-default-features
default: test extensions
default: test
src/py_class/py_class_impl.rs: src/py_class/py_class_impl.py
PY=3 python $< >$@

View File

@ -71,13 +71,13 @@ features = ["extension-module"]
**`src/lib.rs`**
```rust
#[macro_use] extern crate cpython;
#[macro_use] extern crate pye3;
use cpython::{PyResult, Python};
use pyo3::{PyResult, Python};
// add bindings to the generated python module
// N.B: names: "librust2py" must be the name of the `.so` or `.pyd` file
py_module_initializer!(librust2py, initlibrust2py, PyInit_librust2py, |py, m| {
py_module_initializer!(librust2py, PyInit_librust2py, |py, m| {
try!(m.add(py, "__doc__", "This module is implemented in Rust."));
try!(m.add(py, "sum_as_string", py_fn!(py, sum_as_string_py(a: i64, b:i64))));
Ok(())
@ -99,3 +99,6 @@ fn sum_as_string_py(_: Python, a:i64, b:i64) -> PyResult<String> {
```
For `setup.py` integration, see https://github.com/PyO3/setuptools-rust
** This is fork of rust-cpython project https://github.com/dgrunwald/rust-cpython **