Add tox config for pyo3 itself

This commit is contained in:
konstin 2018-10-09 18:49:54 +02:00
parent 4da9110489
commit 38651a1827
3 changed files with 18 additions and 3 deletions

View File

@ -17,6 +17,6 @@ default: test
test:
cargo test $(CARGO_FLAGS)
pip install setuptools-rust pytest pytest-benchmark tox
cd examples/word-count && python setup.py install && pytest -v tests
pip install tox
cd examples/word-count && tox
cd examples/rustapi_module && tox

View File

@ -44,7 +44,8 @@
//!
//! let locals = PyDict::new(py);
//! locals.set_item("os", py.import("os")?)?;
//! let user: String = py.eval("os.getenv('USER') or os.getenv('USERNAME')", None, Some(&locals))?.extract()?;
//! let code = "os.getenv('USER') or os.getenv('USERNAME') or 'Unknown'";
//! let user: String = py.eval(code, None, Some(&locals))?.extract()?;
//!
//! println!("Hello {}, I'm Python {}", user, version);
//! Ok(())

14
tox.ini Normal file
View File

@ -0,0 +1,14 @@
[tox]
envlist = py27,
py35,
py36,
py37,
minversion = 3.4.0
skip_missing_interpreters = true
[testenv]
description = Run the unit tests under {basepython}
skip_install = True
usedevelop = True
whitelist_externals = cargo
commands = cargo test src/lib.rs