Contributing
We welcome contributions to mpcq! This document provides guidelines and instructions for contributing to the project.
Development Setup
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/your-username/mpcq.git cd mpcq
Install PDM if you haven’t already:
pip install pdm
Install development dependencies:
pdm install -G dev
Available Commands
PDM provides several useful commands for development:
Code Quality:
# Run all checks (lint, typecheck, test)
pdm run check
# Format code
pdm run format # Runs black and isort
# Auto-fixes some issues using ruff
pdm run fix # Auto-fixes ruff issues
Testing:
# Run tests
pdm run test # Run all tests (excluding benchmarks)
pdm run doctest # Run doctests only
pdm run benchmark # Run benchmarks only
pdm run coverage # Run tests with coverage report
Documentation:
# Build documentation
pdm run docs-build # Build HTML documentation
pdm run docs-clean # Clean documentation build
pdm run docs-serve # Serve documentation locally
pdm run docs-live # Live-reload documentation during editing
Development Workflow
Create a new branch for your feature:
git checkout -b feature-name
Make your changes, following our coding standards
Run the test suite and linters:
pdm run check # Runs all checks
Commit your changes:
git add . git commit -m "Description of changes"
Push to your fork:
git push origin feature-name
Open a Pull Request on GitHub
Coding Standards
Follow PEP 8 style guidelines
Use type hints for all function parameters and return values
Write docstrings for all public functions and classes
Keep functions focused and single-purpose
Write clear, descriptive variable and function names
Testing
Write tests for all new functionality
Maintain or improve test coverage
Use pytest for testing
Place tests in the
tests/directoryName test files with
test_prefix
Documentation
Update documentation for any modified functionality
Write clear docstrings with examples
Follow Google style for docstrings
Include doctest examples where appropriate
Update the changelog
Example docstring format:
def function_name(param1: type1, param2: type2) -> return_type:
"""Short description of function.
Longer description of function if needed.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
Raises:
ErrorType: Description of when this error is raised
Examples:
>>> function_name(1, 2)
3
"""
Pull Request Process
Update the changelog under “Unreleased”
Ensure all tests pass
Update documentation as needed
Request review from maintainers
Address review feedback
Maintainers will merge after approval
Questions and Support
Open an issue on GitHub for bugs or feature requests
Join our community discussions
Contact maintainers for sensitive issues
License
By contributing, you agree that your contributions will be licensed under the MIT License.