Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 2.84 KB

Contributing.md

File metadata and controls

54 lines (40 loc) · 2.84 KB

Contributing

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.

Getting Started Contributing

Setting up a development environment

  1. Install rust (eg using rustup) and maturin (eg pipx install maturin)
  2. Clone the repository
    • if you are looking to submit a PR, create a fork on github and clone your fork
  3. Install pre-commit (eg pipx install pre-commit) then run pre-commit install in the repo root
  4. 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.

Continuous Integration

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.

Making a release

  1. Bump the version number in pyproject.toml.
  2. Update Changelog.md to reflect the new changes.
  3. Check out the commit you want to make a release from.
  4. Run git tag <version> e.g. git tag v0.1.0.
  5. Run git push origin <version> e.g. git tag v0.1.0.
    • This will trigger the 'release' github action which will upload to PyPi.