Development Workflow Standards¶
This document outlines the standard development workflow for contributing to OCPI Python.
Branch Strategy¶
Main Branch¶
main- Production-ready code- Protected branch (requires PR and approval)
- All commits must pass CI checks
Branch Naming¶
Use conventional branch names:
feat/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoringtest/description- Test additionschore/description- Maintenance tasks
Examples:
- feat/add-payment-module
- fix/token-validation-bug
- docs/update-api-reference
Pull Request Process¶
Before Creating PR¶
- Update branch:
git pull origin main - Run tests:
uv run pytest - Run linting:
uv run ruff check . - Run type checking:
uv run mypy ocpi - Check coverage:
uv run pytest --cov=ocpi --cov-report=term-missing
PR Requirements¶
- [ ] All CI checks passing
- [ ] Code owner approval (automatic via CODEOWNERS)
- [ ] At least 1 approval required
- [ ] No merge conflicts
- [ ] Conventional commit message
- [ ] Description explains changes
PR Template¶
Use the PR template (.github/pull_request_template.md) which includes:
- Description of changes
- Related issues
- Testing performed
- Checklist
Version Management¶
Automatic Versioning¶
We use automatic versioning based on commit messages:
feat:→ Minor bump (M)fix:→ Patch bump (PATCH)BREAKING CHANGE:→ Minor bump (M)
Manual Version Bump¶
If needed, use the version bump script:
Creating Releases¶
- Version is automatically bumped via PR
- Merge the version bump PR
- Create git tag:
git tag v2026.2.0 - Push tag:
git push --tags - Release workflow automatically publishes to PyPI
Testing Requirements¶
Coverage Goals¶
- Core modules: 90%+ coverage
- Module APIs: 80%+ coverage
- Overall: 85%+ coverage
Test Types¶
- Unit tests: Test individual functions/classes
- Integration tests: Test module interactions
- Example tests: Verify example applications work
Running Tests¶
# All tests
uv run pytest
# With coverage
uv run pytest --cov=ocpi --cov-report=term-missing
# Specific test file
uv run pytest tests/test_core/test_utils.py
# Specific test
uv run pytest tests/test_core/test_utils.py::test_get_auth_token
Documentation Standards¶
Documentation Types¶
- API Documentation: Auto-generated from docstrings
- Tutorials: Step-by-step guides
- Examples: Complete working applications
- Standards: This directory
Documentation Updates¶
- Update docs when adding features
- Include code examples
- Keep examples up-to-date
- Use European countries/currencies in examples (DE, ES, CH, DK)
Building Documentation¶
Code Review Process¶
Reviewer Responsibilities¶
- Functionality: Verify the code works
- Standards: Check coding standards compliance
- Tests: Ensure adequate test coverage
- Documentation: Verify documentation is updated
- OCPI Compliance: Check OCPI specification adherence
Author Responsibilities¶
- Self-review: Review your own PR first
- Address feedback: Respond to all comments
- Update PR: Make requested changes
- Keep PR focused: One feature/fix per PR
CI/CD Pipeline¶
Automated Checks¶
- Lint: Ruff formatting and linting
- Type Check: MyPy type checking
- Tests: Pytest on Python 3.11 and 3.12
- Coverage: Codecov coverage reporting
Workflow Triggers¶
- Push to main: Runs all checks
- Pull Request: Runs all checks
- Tag push: Triggers release workflow
- Version bump: Creates PR automatically
Release Process¶
Pre-Release Checklist¶
- [ ] All tests passing
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
- [ ] Version bumped
- [ ] Tag created
Release Steps¶
- Version bump PR is merged
- Create git tag:
git tag v2026.2.0 - Push tag:
git push --tags - Release workflow:
- Builds package
- Verifies version
- Publishes to PyPI
Post-Release¶
- [ ] Verify package on PyPI
- [ ] Test installation:
uv pip install ocpi-python - [ ] Update release notes on GitHub
- [ ] Announce release (if applicable)
Issue Management¶
Issue Types¶
- Bug Report: Use
.github/ISSUE_TEMPLATE/bug_report.md - Feature Request: Use
.github/ISSUE_TEMPLATE/feature_request.md - Question: Use GitHub Discussions
Issue Labels¶
bug- Something isn't workingenhancement- New feature or requestdocumentation- Documentation improvementsquestion- Further information is requestedgood first issue- Good for newcomers
Communication Standards¶
Code Comments¶
- Explain why, not what
- Use docstrings for public APIs
- Keep comments up-to-date with code
Commit Messages¶
- Use conventional commit format
- Be descriptive but concise
- Reference issues when applicable
PR Descriptions¶
- Explain what changed and why
- Include related issue numbers
- Add screenshots for UI changes
- List breaking changes