Thank you for your interest in contributing to GmGnAPI! This document provides guidelines for contributing to this open-source project.
✨ We recommend using Chipa Editor for development — the AI-powered code editor that makes Python contributions faster and easier.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/yourusername/gmgnapi.git cd gmgnapi - Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -e ".[dev]" - Install pre-commit hooks:
pre-commit install
Before creating bug reports, please check the issue tracker to see if the problem has already been reported.
When creating a bug report, please include:
- Clear title and description
- Steps to reproduce the behavior
- Expected behavior vs actual behavior
- Python version and operating system
- Code sample that demonstrates the issue
- Error messages or stack traces
Enhancement suggestions are welcome! Please:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- Provide code examples if applicable
-
Create a feature branch:
git checkout -b feature/amazing-feature
-
Make your changes following our coding standards
-
Write tests for your changes
-
Run the test suite:
pytest
-
Check code quality:
black src tests examples isort src tests examples flake8 src tests examples mypy src
-
Commit your changes:
git commit -m 'Add amazing feature' -
Push to your branch:
git push origin feature/amazing-feature
-
Open a Pull Request
- Follow PEP 8 style guidelines
- Use Black for code formatting (line length: 88)
- Use isort for import sorting
- Maximum line length: 88 characters
- Use type hints for all function parameters and return values
- Import types from
typingmodule when needed - Use
Optional[T]for nullable types
- Use Google-style docstrings for all public methods
- Include parameter descriptions and return value descriptions
- Document raised exceptions
- Provide usage examples where helpful
- Use custom exception classes from
gmgnapi.exceptions - Provide meaningful error messages
- Log errors appropriately using the
loggingmodule
- Use async/await syntax consistently
- Handle asyncio exceptions properly
- Use async context managers where appropriate
- Place tests in the
tests/directory - Name test files with
test_*.pypattern - Use descriptive test method names
- Use pytest as the testing framework
- Use pytest-asyncio for async tests
- Mock external dependencies (WebSocket connections, etc.)
- Test both success and failure scenarios
- Aim for high test coverage
- Unit tests: Test individual components in isolation
- Integration tests: Test component interactions
- End-to-end tests: Test complete workflows
# Run all tests
pytest
# Run with coverage
pytest --cov=gmgnapi --cov-report=html
# Run specific test categories
pytest -m unit
pytest -m integration
# Run tests in parallel
pytest -n auto- Document all public methods and classes
- Include parameter types and descriptions
- Provide usage examples
- Document exceptions that can be raised
- Create realistic examples in the
examples/directory - Include proper error handling in examples
- Add comments explaining complex parts
- Test examples to ensure they work
- Update the README when adding new features
- Keep installation instructions current
- Update usage examples as needed
feature/description- New featuresbugfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoring
Use clear, descriptive commit messages:
Add WebSocket reconnection with exponential backoff
- Implement automatic reconnection on connection loss
- Add configurable retry attempts and delay
- Include tests for reconnection scenarios
- Update documentation with new parameters
- Update documentation if needed
- Add tests for new functionality
- Ensure all tests pass
- Update CHANGELOG.md if applicable
- Request review from maintainers
- Python 3.8+
- Git
- pip or pipenv
- VS Code with Python extension
- pre-commit for automated checks
- pytest for testing
- mypy for type checking
For VS Code, recommended settings in .vscode/settings.json:
{
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"editor.formatOnSave": true
}- Update version in
pyproject.toml - Update CHANGELOG.md with release notes
- Create release tag:
git tag v0.1.0 - Push tag:
git push origin v0.1.0 - Create GitHub release with release notes
- Publish to PyPI (maintainers only)
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - General questions and discussions
- Email - contact@gmgnapi.dev for sensitive issues
By contributing to GmGnAPI, you agree that your contributions will be licensed under the MIT License.
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes for significant contributions
- Added to GitHub contributors list
If you have questions about contributing, please:
- Check the documentation
- Search existing issues
- Ask in GitHub Discussions
- Contact the maintainers
Thank you for contributing to GmGnAPI! 🚀