|
| 1 | +# Contributing to Steadfast Courier Python SDK |
| 2 | + |
| 3 | +Thank you for your interest in contributing! This document provides guidelines and instructions for contributing. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. Fork the repository |
| 8 | +2. Clone your fork: `git clone https://github.com/your-username/steadfast-python.git` |
| 9 | +3. Create a virtual environment: `python3 -m venv venv` |
| 10 | +4. Activate it: `source venv/bin/activate` |
| 11 | +5. Install dev dependencies: `pip install -r requirements-dev.txt` |
| 12 | +6. Install pre-commit hooks: `pre-commit install` |
| 13 | + |
| 14 | +## Development Workflow |
| 15 | + |
| 16 | +1. Create a feature branch: `git checkout -b feature/your-feature` |
| 17 | +2. Make your changes |
| 18 | +3. Run quality checks: `./scripts/quality-check.sh` |
| 19 | +4. Commit with legacy-style messages: `git commit -m "Add feature description"` |
| 20 | +5. Push to your fork: `git push origin feature/your-feature` |
| 21 | +6. Create a Pull Request |
| 22 | + |
| 23 | +## Code Quality Standards |
| 24 | + |
| 25 | +All code must pass: |
| 26 | + |
| 27 | +- **Black** - Code formatting (88 character line length) |
| 28 | +- **Flake8** - Linting |
| 29 | +- **MyPy** - Type checking (strict mode) |
| 30 | +- **Pytest** - All tests must pass |
| 31 | + |
| 32 | +Run checks manually: |
| 33 | +```bash |
| 34 | +./scripts/quality-check.sh |
| 35 | +``` |
| 36 | + |
| 37 | +## Testing |
| 38 | + |
| 39 | +- Write tests for all new features |
| 40 | +- Maintain 80%+ code coverage |
| 41 | +- Test edge cases and error scenarios |
| 42 | +- Use descriptive test names |
| 43 | + |
| 44 | +Run tests: |
| 45 | +```bash |
| 46 | +pytest tests/ -v |
| 47 | +pytest tests/ --cov=steadfast --cov-report=html |
| 48 | +``` |
| 49 | + |
| 50 | +## Type Hints |
| 51 | + |
| 52 | +All functions must have type hints: |
| 53 | + |
| 54 | +```python |
| 55 | +def create_order( |
| 56 | + invoice: str, |
| 57 | + recipient_name: str, |
| 58 | + cod_amount: float |
| 59 | +) -> Order: |
| 60 | + """Create an order.""" |
| 61 | + pass |
| 62 | +``` |
| 63 | + |
| 64 | +## Documentation |
| 65 | + |
| 66 | +- Update docstrings for all functions |
| 67 | +- Add examples for new features |
| 68 | +- Update relevant documentation files |
| 69 | +- Keep README.md current |
| 70 | + |
| 71 | +## Commit Messages |
| 72 | + |
| 73 | +Use legacy-style commit messages without emojis: |
| 74 | + |
| 75 | +``` |
| 76 | +Add feature description |
| 77 | +Fix bug in module |
| 78 | +Update documentation |
| 79 | +``` |
| 80 | + |
| 81 | +## Pull Request Process |
| 82 | + |
| 83 | +1. Update documentation |
| 84 | +2. Add/update tests |
| 85 | +3. Ensure all checks pass |
| 86 | +4. Provide clear PR description |
| 87 | +5. Link related issues |
| 88 | + |
| 89 | +## Code of Conduct |
| 90 | + |
| 91 | +Be respectful and professional. We're committed to providing a welcoming environment. |
| 92 | + |
| 93 | +## Questions? |
| 94 | + |
| 95 | +Open an issue or contact the maintainers. |
| 96 | + |
| 97 | +Thank you for contributing! |
0 commit comments