Thank you for your interest in contributing to maturin_import_hook. All are welcome! Please consider reading the Code of Conduct to keep our community positive and inclusive.
- we use the github issue tracker and discussions to keep track of bugs and ideas
- Install rust (eg using
rustup
) and maturin (egpipx install maturin
) - Clone the repository
- if you are looking to submit a PR, create a fork on github and clone your fork
- Install pre-commit (eg
pipx install pre-commit
) then runpre-commit install
in the repo root - See tests/README.md for instructions on how best to run the test suite and some other miscellaneous instructions for debugging and carrying out maintenance tasks.
Tips:
- pyenv may be useful for installing a specific python interpreter
- Virtual machines such as VirtualBox and OSX-KVM are useful for running tests on specific platforms locally. Or you can use the test pipeline on github actions.
The maturin_import_hook repo uses GitHub actions. PRs are blocked from merging if the CI is not successful.
You can run the test pipeline on your fork from the 'Actions' tab of your fork. The pipeline takes several arguments when run manually that you can use to narrow down what is run so you can iterate faster when trying to solve a particular issue. The pipeline uploads the test results as html reports that can be downloaded and examined. This is generally easier than sifting through the raw logs.
Linting and type-checking is enforced in the repo using pre-commit.
See .pre-commit-config.yaml
for the checks that are performed and pyproject.toml
for the configuration
of those linters.
The configuration starts with all ruff
lints enabled with a list of specifically disabled lints.
If you are writing new code that is triggering a lint that you think ought to be disabled, you can suggest this in
a PR, but generally stick to conforming to the suggested linter rules.
- Bump the version number in
pyproject.toml
. - Update
Changelog.md
to reflect the new changes. - Check out the commit you want to make a release from.
- Run
git tag <version>
e.g.git tag v0.1.0
. - Run
git push origin <version>
e.g.git tag v0.1.0
.- This will trigger the 'release' github action which will upload to PyPi.