Thank you for your interest in contributing to PyANTDisplay! This document provides guidelines for contributing to the project.
-
Fork and clone the repository:
git clone https://github.com/Velotales/pyAntDisplay.git cd pyAntDisplay -
Set up the development environment:
# Linux/macOS ./setup.sh # Windows setup.bat
-
Install development dependencies:
source .venv/bin/activate # Linux/macOS # or .venv\Scripts\activate.bat # Windows pip install -r requirements-dev.txt
-
Set up pre-commit hooks:
pre-commit install
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and write tests:
- Add tests for new functionality in the
tests/directory - Ensure all tests pass:
pytest - Check code coverage:
pytest --cov=src
- Add tests for new functionality in the
-
Run code quality checks:
# Format code black src tests # Lint code flake8 src tests # Type checking mypy src
-
Commit your changes:
git add . git commit -m "Add your descriptive commit message"
-
Push and create a pull request:
git push origin feature/your-feature-name
- Follow PEP 8 style guidelines
- Use Black for code formatting (line length: 88)
- Write type hints for all functions
- Add docstrings for all public functions and classes
- Keep functions small and focused
- Write unit tests for all new functionality
- Use pytest for testing
- Mock external dependencies (USB, ANT+ hardware)
- Aim for high test coverage (>90%)
- Test edge cases and error conditions
- Update README.md for user-facing changes
- Add docstrings for new functions/classes
- Update configuration examples if needed
- Document any new dependencies
- Provide a clear description of the changes
- Reference any related issues
- Ensure all tests pass
- Include screenshots/examples if relevant
- Keep pull requests focused and atomic
- Use the GitHub issue tracker
- Provide clear reproduction steps
- Include system information (OS, Python version)
- Specify ANT+ device types if relevant
When adding support for new ANT+ device types:
- Create a new module in
src/pyantdisplay/ - Follow the existing pattern (HeartRateMonitor, BikeSensor)
- Add device type to the scanner's supported types
- Write comprehensive tests
- Update documentation and examples
- Update version in
pyproject.toml - Update CHANGELOG.md
- Create a git tag:
git tag v1.0.0 - Push tag:
git push origin v1.0.0 - GitHub Actions will handle the release
Feel free to open an issue for questions or discussions about contributing.