Contributing to MsgCenterPy
Thank you for your interest in contributing to MsgCenterPy! This document provides guidelines for contributing to the project.
Quick Links
Development Setup
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/MsgCenterPy.git
cd MsgCenterPy
(Optional) If you need ROS2 support, set up ROS environment first:
# Create and activate conda environment with ROS2
conda create -n msgcenterpy-dev python=3.11
conda activate msgcenterpy-dev
conda install ros-humble-ros-core ros-humble-std-msgs ros-humble-geometry-msgs -c robostack-staging
Run the development setup script:
Linux/macOS:
./scripts/setup-dev.sh
Windows:
.\scripts\setup-dev.ps1
The setup script will automatically:
Install the package in development mode with all dependencies
Set up pre-commit hooks
Run initial code quality checks
Display helpful commands for development
Code Style and Quality
We use automated code quality checks that run via pre-commit hooks:
Black: Code formatting (line length: 120)
isort: Import sorting
flake8: Code linting
mypy: Type checking
bandit: Security scanning
prettier: YAML/JSON formatting
These checks run automatically when you commit. You can also run them manually:
# Run all pre-commit hooks
pre-commit run --all-files
Testing
Important: Always run tests before committing to ensure your changes work correctly.
# Run all tests
pytest
# Run with verbose output
pytest -v
Note: If ROS2 is not installed, ROS-related tests will be automatically skipped. The test suite is designed to work with or without ROS2 dependencies.
Version Management
This project uses bump2version for version management. It’s automatically installed with dev dependencies.
# Bug fixes (0.0.1 → 0.0.2)
bump2version patch
# New features (0.0.2 → 0.1.0)
bump2version minor
# Breaking changes (0.1.0 → 1.0.0)
bump2version major
After bumping version, push changes and tags:
git push && git push --tags
Submitting Changes
Create a new branch for your feature/fix
Make your changes and add tests
Run tests to ensure everything works
Update documentation if needed
Submit a pull request with: - Descriptive title and description - Reference to related issues - Tests for new features
Getting Help
Check existing Issues