First off, thanks for taking the time to contribute! 🎉
Kew is a community project and every contribution helps make it better. Whether you're fixing a bug, adding a feature, or improving documentation, your help is welcome.
- Fork the repository
- Clone your fork:
git clone https://github.com/justrach/kew.git
cd kew
- Set up your development environment:
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
# Install development dependencies
pip install -e ".[dev]"
- Start Redis (required for running tests):
docker run -d -p 6379:6379 redis:alpine
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
-
Make your changes
-
Run the test suite:
pytest tests/
- Format your code:
black kew/
isort kew/
- Run the linter:
flake8 kew/
We use pytest for our test suite. All new features should include tests. To run tests:
# Run all tests
pytest
# Run specific test file
pytest tests/test_specific.py
# Run with coverage report
pytest --cov=kew tests/
- All tests must pass
- Coverage should not decrease
- New features must include tests
- Tests should include both success and error cases
We follow PEP 8 with some modifications:
- Line length: 88 characters (Black default)
- Use double quotes for strings
- Use explicit type hints where beneficial
We use these tools to maintain code quality:
- Black for code formatting
- isort for import sorting
- flake8 for linting
- Update the README.md with details of your changes if needed
- Update the docs/ folder with any new documentation
- Add or update tests as needed
- Update the CHANGELOG.md following the Keep a Changelog format
- Submit your pull request
- Clear description of changes
- Tests pass
- Code formatted with Black
- No linting errors
- Documentation updated if needed
- CHANGELOG.md updated
We follow the conventional commits specification. Each commit message should have a type:
feat: Add new feature
fix: Fix bug
docs: Update documentation
test: Add tests
chore: Update tooling or dependencies
Example:
feat: Add circuit breaker reset timeout configuration
- Add reset_timeout parameter to QueueConfig
- Update documentation
- Add tests for timeout behavior
If you're adding new features, please include:
- Docstrings for new functions/classes
- Updates to the relevant docs/ files
- Examples in the README if appropriate
If you're not sure about something:
- Check existing issues and pull requests
- Open an issue to discuss major changes
- Ask questions in the pull request
Please include:
- Python version
- Kew version
- Minimal code to reproduce
- Expected vs actual behavior
Please include:
- Use case description
- Example code showing desired API
- Explanation of why it's useful
We especially welcome:
- Bug fixes
- Performance improvements
- Documentation improvements
- New features
- Test improvements
# Using Docker
docker run -d -p 6379:6379 redis:alpine
# Or install locally
sudo apt-get install redis-server # Ubuntu
brew install redis # macOS
# Run tests with output
pytest -v
# Format code
black kew/
isort kew/
# Check types
mypy kew/
# Build docs
cd docs/
make html
By contributing, you agree that your contributions will be licensed under the MIT License.