Contributing Guide¶
We welcome contributions to cymongoose! This guide will help you get started.
Ways to Contribute¶
- Bug Reports: Report issues on GitHub
- Feature Requests: Suggest new features
- Documentation: Improve docs and examples
- Code: Fix bugs or add features
- Testing: Add test cases
- Examples: Add usage examples
Getting Started¶
1. Fork the Repository¶
# Fork on GitHub, then clone
git clone https://github.com/YOUR-USERNAME/cymongoose.git
cd cymongoose
2. Set Up Development Environment¶
3. Create a Branch¶
Code Guidelines¶
Style¶
- Follow PEP 8 for Python code
- Use 4-space indentation
- 100-character line limit
- Use double quotes for strings
Testing¶
All code must be tested!
Example test:
Documentation¶
- Add docstrings to all public functions
- Update relevant documentation files in docs/
- Include examples
Pull Request Process¶
1. Write Tests¶
Ensure your changes are covered by tests:
All tests must pass!
2. Update Documentation¶
- Add docstrings
- Update relevant documentation
- Add examples if needed
3. Format Code¶
4. Commit Changes¶
Use clear commit messages:
- "Fix: description of bug fix"
- "Add: new feature description"
- "Update: what was updated"
- "Docs: documentation changes"
5. Push and Create PR¶
Create pull request on GitHub.
PR Checklist¶
- [ ] Tests pass
- [ ] Code formatted with ruff
- [ ] Documentation updated
- [ ] Commit messages are clear
- [ ] No merge conflicts
Review Process¶
- Maintainer reviews your PR
- Address any feedback
- Once approved, PR is merged
Common Tasks¶
Adding a New Feature¶
- Write tests first (TDD)
- Implement feature
- Update documentation
- Submit PR
Fixing a Bug¶
- Write test that reproduces bug
- Fix bug
- Verify test passes
- Submit PR
Adding Examples¶
- Add example in
tests/examples/ - Make it runnable:
python tests/examples/your_example.py - Add test in
tests/examples/test_*.py - Document in
docs/examples.md
Updating Documentation¶
- Edit files in
docs/ - Build locally:
cd docs && make html - Check output in
docs/_build/html/ - Submit PR
Development Tips¶
Rebuilding After Changes¶
# Force rebuild after Cython changes
rm src/cymongoose/_mongoose.c
pip install -e . --force-reinstall
Debug Build¶
Verbose Tests¶
Test Single File¶
Communication¶
- GitHub Issues: Bug reports and feature requests
- Pull Requests: Code contributions
- Discussions: Questions and ideas
Code of Conduct¶
Be respectful and professional in all interactions.
Questions?¶
Feel free to open an issue or discussion on GitHub.
Thank You¶
Thank you for contributing to cymongoose!