diff --git a/Cargo.toml b/Cargo.toml index 8d12c61..b34b032 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,11 @@ license = "Apache-2.0" [lib] name = "unit_converter" -crate-type = ["cdylib"] +crate-type = ["cdylib", "rlib"] -[dependencies] -pyo3 = { version = "0.8", features = ["extension-module"] } +[dependencies.pyo3] +version = "0.8" + +[features] +extension-module = ["pyo3/extension-module"] +default = ["extension-module"] diff --git a/README.md b/README.md index 93ff293..fbbf2ac 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ Insure the following dependencies are in place: 1. Build the rust crate first: `cargo build` 1. Install dependencies and run in a virtualenv: `pipenv install && pipenv shell` 1. Create the Python package with: `maturin build` -1. Run the tests: `pytest test.py` +1. Run the Python tests: `pytest test.py batch_test.py` +1. Run the Rust test: `cargo test --no-default-features` ## Documentation diff --git a/src/lib.rs b/src/lib.rs index 30e9d19..22516b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,6 +63,6 @@ mod tests { #[test] fn windchill_test() { let temperature = Temperature{ celsius: -20.0 }; - assert_eq!(temperature.windchill(32.0).round(), -32.9); + assert_eq!(temperature.windchill(32.0).round(), -33.0); } }