Development Guide
This guide will help you set up your development environment for contributing to signalrgb-python.
๐งฐ Prerequisites
Before you begin, ensure you have the following installed on your system:
- Python 3.9 or higher
- UV for dependency management
- Git for version control
๐ Setting Up the Development Environment
- Clone the repository:
- Install the project dependencies using UV:
- To run commands in the development environment:
For example, to run a Python script:
๐งช Running Tests
We use pytest for our test suite. To run the tests:
To run tests with coverage report:
๐ Linting
We use Ruff for linting and formatting. To run the linter:
To automatically fix linting issues:
๐ Type Checking
We use mypy for static type checking. To run the type checker:
๐ Pre-commit Hooks
We use pre-commit hooks to ensure code quality before committing. To set up pre-commit hooks:
- Install pre-commit:
- Run pre-commit on all files:
The pre-commit hooks will now run automatically on git commit
.
๐ Building Documentation
To build the documentation locally:
- Make sure you've installed the development dependencies:
- Build and serve the documentation:
- Open your browser and navigate to
http://127.0.0.1:8000/
to view the documentation.
๐ฆ Creating a New Release
- Update the version number in
pyproject.toml
:
-
Update the
CHANGELOG.md
file with the changes for the new version. -
Commit the changes:
- Create a new tag:
- Push the changes and the new tag:
The CI/CD pipeline will handle the rest, including building and publishing the package to PyPI and deploying the updated documentation.
๐ Troubleshooting
If you encounter any issues during development, please check the following:
- Ensure you're using the correct version of Python (3.9+).
- Make sure all dependencies are up to date (
uv sync
). - Clear any cached files:
If you're still having problems, please open an issue on the GitHub repository with a detailed description of the problem and steps to reproduce it.
๐ฌ Getting Help
If you need help with development, you can:
- Open an issue on the GitHub repository.
- Reach out to the maintainers directly (contact information can be found in the
README.md
file).