Contributing to RedBeat

Contributions are welcome! This guide outlines how to set up your development environment, run tests, and contribute to the project.

Development Setup

It is recommended to use make for setting up the environment and running common tasks.

  1. Clone the Repository

    git clone https://github.com/sibson/redbeat.git
    cd redbeat
  2. Install Dependencies

    The setup command will create a virtual environment (if needed) and install all development requirements.

    make setup

    Alternatively, you can install the dependencies manually:

    pip install -r requirements-dev.txt
    pip install -e .

Running Tests

RedBeat uses Python's built-in unittest framework. You can run the full test suite using make.

make test

This command discovers and runs all tests in the tests/ directory.

To run tests manually:

python -m unittest discover tests

Code Style & Linting

This project uses black for code formatting and flake8 for linting. The CI pipeline will fail if the code does not adhere to the style guide.

To run the linter:

make lint

Or directly:

flake8 redbeat tests

Submitting Changes

  1. Create a new branch for your feature or bug fix.
  2. Make your changes and add tests to cover them.
  3. Ensure all tests and lint checks pass.
  4. Push your branch to your fork and open a pull request against the main branch.

Release Process (for maintainers)

Releasing a new version to PyPI is managed via make.

  1. Run Checks: Ensure the working directory is clean and tests are passing.

    make release-check

  2. Create Release: Bump the version number in setup.cfg and CHANGES.txt, commit the changes, and create a git tag.

    VERSION='X.Y.Z' make release

  3. Publish: The GitHub Actions workflow will automatically build and publish the tagged release to PyPI.