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.
-
Clone the Repository
git clone https://github.com/sibson/redbeat.git cd redbeat -
Install Dependencies
The
setupcommand will create a virtual environment (if needed) and install all development requirements.make setupAlternatively, 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
- Create a new branch for your feature or bug fix.
- Make your changes and add tests to cover them.
- Ensure all tests and lint checks pass.
- Push your branch to your fork and open a pull request against the
mainbranch.
Release Process (for maintainers)
Releasing a new version to PyPI is managed via make.
-
Run Checks: Ensure the working directory is clean and tests are passing.
make release-check -
Create Release: Bump the version number in
setup.cfgandCHANGES.txt, commit the changes, and create a git tag.VERSION='X.Y.Z' make release -
Publish: The GitHub Actions workflow will automatically build and publish the tagged release to PyPI.