A demo project showing rust code in a python project with the Poetry package manager, pyO3, and Maturin.
poetry run make install
You will need to run maturin develop
again if you change the rust code.
poetry run make test
(untested, don't know if this works properly with the project configuration)
poetry run make build
.github/workflows/CI.yml
defines a GitHub Actions workflow that runs python and rust tests on push.
Rust modules are defined in the src
directory. The Cargo.toml
file defines the rust project and dependencies.
Python modules are in the rusty_poetry
directory. The pyproject.toml
file defines the python project and dependencies.
rusty_poetry/__init__.py
imports the rust code into the python module.