Contributing

Requirements

ridbPy uses Poetry to manage its Python environment. To get started first install poetry:

pipx install poetry

pipx is preferred, but you can also install with pip install --user.

Coding

ridbPy makes use of a couple tools to help with contributing via pre-commit. pre-commit is a tool to manage git-hooks scripts, which are useful for identifying simple issues before submission to code review.

pipx install pre-commit
pre-commit install
  • ridbPy’s instance of pre-commit uses tools like black and isort to format your code in a standardized way.

  • After cloning this repo run pre-commit install.

  • Done, now pre-commit will run automatically on git commit. To run it manually on your changed code run pre-commit run on your command line.

Running

Run the command-line interface from the source tree:

poetry install
poetry run ridbpy

Run an interactive Python session:

poetry install
poetry run python

Testing

  • tox is a tool to standardize and manage testing and routines using Python virtual environments

  • ridbPy’s instance of tox runs Python unit tests, and uses tools like mypy and flake8 to format.

  • To run all tox tests (which get run as part of GitHub Actions) locally, just enter tox into your command line or use poetry.

Run the Full Test Suite:

poetry run tox

Run Just One Testing Tool:

poetry run tox -e mypy

Releasing

Releases are triggered entirely by CI/CD via Pull requests being merged into the main branch.

The version bump on each release is decided by the labels placed on the Pull Requests. There must be one, and only one, of the following labels on each pull request to the main branch: BUMP_MAJOR, BUMP_MINOR, BUMP_PATCH. Pull Requests will be un-mergeable unless the version on your pyproject.toml matches the main branch and the proper version labels are applied.

The Release workflow performs the following automated steps:

  • Publish a GitHub Release.

  • Apply a version tag to the repository.

Release notes are populated with the titles and authors of merged pull requests. You can group the pull requests into separate sections by applying labels to them, like this:

Pull Request Label

Section in Release Notes

breaking

💥 Breaking Changes

enhancement

🚀 Features

removal

🔥 Removals and Deprecations

bug

🐞 Fixes

performance

🐎 Performance

testing

🚨 Testing

ci

👷 Continuous Integration

documentation

📚 Documentation

refactoring

🔨 Refactoring

style

💄 Style

dependencies

📦 Dependencies