Contributions are welcome, and they are greatly appreciated!
You can contribute in many ways:
Types of Contributions
Report bugs at https://github.com/PyO3/maturin/issues.
Look through the GitHub issues for bugs. Anything tagged with
help wanted is open to whoever wants to implement it.
Look through the GitHub issues for features.
Maturin could always use more documentation, whether as part of the official guide, in docstrings or even on the web in blog posts, articles and such.
The best way to send feedback is to start a new discussion at https://github.com/PyO3/maturin/discussions.
Ready to contribute? Here's how to setup maturin for local development.
- Fork the maturin repository on GitHub.
- Clone your fork locally:
$ git clone email@example.com:your_name_here/maturin.git
- Install a stable Rust toolchain and of course Python 3.6 or later is also required.
- Create a branch for local development:
Now you can make your changes locally.
$ cd maturin $ git checkout -b branch-name
- When you're done making changes, format your changes with
cargo fmt, then lint with
cargo clippyand test them with
Note that in order to run tests you need to install
$ cargo fmt $ cargo clippy $ cargo test
pip3 install cffi virtualenv).
- Commit your changes and push your branch to GitHub:
$ git add . $ git Commit $ git push origin branch-name
- Submit a pull request through the GitHub website.
We provide a pre-configured dev container that could be used in Github Codespaces, VSCode, JetBrains, JuptyerLab.
Pull Request Guidelines
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests if it adds or changes functionalities.
- Add a changelog entry.
- When command line interface changes, run
python3 test-crates/update_readme.pyto update related documentation.
The main part is the maturin library, which is completely documented and should be well integrable. The accompanying
main.rs takes care username and password for the pypi upload and otherwise calls into the library.
sysconfig folder contains the output of
python -m sysconfig for different python versions and platform, which is helpful during development.
You need to install
pip install cffi virtualenv) to run the tests.
You can set the
MATURIN_TEST_PYTHON environment variable to run the tests against a specific Python version,
MATURIN_TEST_PYTHON=python3.11 cargo test will run the tests against Python 3.11.
There are some optional hacks that can speed up the tests (over 80s to 17s on my machine).
- By running
cargo build --release --manifest-path test-crates/cargo-mock/Cargo.tomlyou can activate a cargo cache avoiding to rebuild the pyo3 test crates with every python version.
target/test-cacheto clear the cache (e.g. after changing a test crate) or remove
test-crates/cargo-mock/target/release/cargoto deactivate it.
- By running the tests with the
faster-testsfeature, binaries are stripped and wheels are only stored and not compressed.