Dorian 4000c1a86a | ||
---|---|---|
src | ||
.gitignore | ||
Cargo.toml | ||
LICENSE.md | ||
Pipfile | ||
Pipfile.lock | ||
README.md | ||
test.py |
README.md
Embedded Unit Converter
Embed a small bit of code that converts between units of measure, e.g. Fahrenheit to Celsius.
An example of a Rust library that is embeddable in Python and Web Assembly.
Getting setup
Insure the following dependencies are in place:
- Rust v1.32+ (nightly)
- Install using
rustup toolchain install nightly
- Set default toolchain
rustup default nightly
- Install using
- Python 3 Development headers (python3-dev in Ubuntu)
- pipenv
pip install --user pipenv
Running the Python example
- Build the rust crate first:
cargo build
- Create the Python package with:
pyo3 develop
- Run the tests:
pytest test.py