We welcome contributions to the Pathao Python SDK! This document provides guidelines for contributing to the project.
- Python 3.8 or higher
- Git
-
Fork and clone the repository
git clone https://github.com/yourusername/pathao-python.git cd pathao-python -
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies
pip install -r requirements-dev.txt pip install -e . -
Install pre-commit hooks
pre-commit install
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write code following the project's style guidelines
- Add tests for new functionality
- Update documentation as needed
-
Run tests and quality checks
# Run tests pytest # Run with coverage pytest --cov=pathao --cov-report=term-missing # Format code black pathao tests # Lint code flake8 pathao tests # Type check mypy pathao
-
Commit your changes
git add . git commit -m "feat: add new feature description"
-
Push and create a pull request
git push origin feature/your-feature-name
- Follow PEP 8 style guidelines
- Use Black for code formatting (line length: 88 characters)
- Use flake8 for linting
- Include type hints for all functions and methods
- Write comprehensive docstrings using Google style
Use conventional commits format:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test additions/changesrefactor:for code refactoringstyle:for formatting changeschore:for maintenance tasks
- Write tests for all new functionality
- Maintain or improve test coverage (target: 80%+)
- Use descriptive test names and docstrings
- Mock external dependencies appropriately
- Include both positive and negative test cases
- Update relevant documentation for new features
- Include code examples in docstrings
- Update README.md if needed
- Add entries to CHANGELOG.md
pathao-python/
├── pathao/ # Main package
│ ├── __init__.py # Package initialization
│ ├── client.py # Main client class
│ ├── exceptions.py # Custom exceptions
│ ├── models.py # Data models
│ ├── validators.py # Input validation
│ ├── logger.py # Logging utilities
│ ├── http_client.py # HTTP client wrapper
│ └── modules/ # Service modules
│ ├── auth.py # Authentication
│ ├── store.py # Store management
│ ├── order.py # Order management
│ ├── location.py # Location services
│ └── price.py # Price calculation
├── tests/ # Test suite
├── docs/ # Documentation
├── examples/ # Usage examples
└── .github/ # GitHub workflows
# Run all tests
pytest
# Run with coverage
pytest --cov=pathao --cov-report=html
# Run specific test file
pytest tests/test_client.py
# Run tests with specific marker
pytest -m unit- Unit tests: Test individual components in isolation
- Integration tests: Test component interactions
- Sandbox tests: Test against real Pathao sandbox API
- Use descriptive test class and method names
- Follow the Arrange-Act-Assert pattern
- Mock external dependencies
- Test both success and error scenarios
- Include edge cases and boundary conditions
- All public classes and methods must have docstrings
- Use Google-style docstrings
- Include examples in docstrings where helpful
- Document all parameters, return values, and exceptions
- Update relevant guides in
docs/directory - Include practical examples
- Keep documentation up-to-date with code changes
-
Before submitting
- Ensure all tests pass
- Run code quality checks
- Update documentation
- Add changelog entry
-
Pull request requirements
- Use the provided PR template
- Include clear description of changes
- Reference related issues
- Ensure CI checks pass
-
Review process
- Address reviewer feedback
- Keep PR focused and atomic
- Maintain clean commit history
- Use the bug report template
- Include minimal reproduction case
- Provide environment details
- Include error messages and stack traces
- Use the feature request template
- Describe the use case clearly
- Consider backwards compatibility
- Provide implementation suggestions if possible
This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
If you have questions about contributing, please:
- Check existing documentation
- Search existing issues
- Create a new issue with the question label
- Reach out to maintainers
Thank you for contributing to the Pathao Python SDK!