Thank you for your interest in contributing! This document provides guidelines for contributing to RowQuery.
- Python >=3.10
- uv package manager
# Clone repository
git clone https://github.com/maksim-shevtsov/RowQuery.git
cd RowQuery
# Install all dependencies (including all database drivers)
uv sync --extra all --extra dev
# Install pre-commit hooks
uv run pre-commit install# All tests
uv run pytest
# Unit tests only
uv run pytest tests/unit/
# Contract tests (adapter protocol compliance)
uv run pytest tests/contract/
# Integration tests (SQLite)
uv run pytest tests/integration/ -m integration
# With coverage
uv run pytest --cov=row_query --cov-report=htmlThis project uses strict quality standards enforced by CI.
# Check for issues
uv run ruff check row_query/ tests/
# Auto-fix issues
uv run ruff check --fix row_query/ tests/
# Format code
uv run ruff format row_query/ tests/# Strict mypy type checking
uv run mypy row_query/Pre-commit hooks run automatically on commit. To run manually:
uv run pre-commit run --all-filesmain is protected — direct commits and force-pushes are blocked. All changes must go through a pull request from a feature branch.
Use a short numeric prefix followed by a kebab-case description:
NNN-short-description
Examples:
001-sql-projection-engine
002-add-postgres-pooling
003-fix-aggregate-null-handling
main (protected)
└── 001-my-feature ← work here
└── commits...
└── open PR → review → merge into main
Never commit directly to main. Always:
git checkout main && git pull # start from latest main
git checkout -b 042-my-feature # create feature branch
# ... make changes ...
git push -u origin 042-my-feature # push feature branch
gh pr create # open PR targeting mainFeature branches should be rebased or merged up-to-date with main before the PR can be merged (enforced by branch protection).
git checkout main && git pull
git checkout -b NNN-short-description- Write code following existing patterns
- Add tests for new functionality
- Update docstrings
- Update
CHANGELOG.mdunder[Unreleased] - Run quality checks locally
We encourage (but don't require) conventional commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesrefactor:- Code refactoringtest:- Test additions/changeschore:- Maintenance tasks
Examples:
git commit -m "feat: add support for custom query namespaces"
git commit -m "fix: handle null values in aggregate mapping"
git commit -m "docs: add examples for async transactions"- Ensure all tests pass:
uv run pytest - Verify no lint errors:
uv run ruff check row_query/ tests/ - Verify formatting:
uv run ruff format --check row_query/ tests/ - Check types:
uv run mypy row_query/
git push -u origin NNN-short-description
gh pr create --base main- Fill out the PR template
- Wait for CI to pass
- Address review comments
- Keep the branch up-to-date with
mainbefore merging
- Follow PEP 8 (enforced by Ruff)
- Use type hints everywhere (enforced by mypy strict mode)
- Write docstrings for public APIs (Google style)
- Keep functions focused and testable
- Prefer composition over inheritance
- Use protocol classes for polymorphism
- Unit tests (
tests/unit/): Test individual functions/classes in isolation - Contract tests (
tests/contract/): Verify protocol compliance (adapters, mappers) - Integration tests (
tests/integration/): Test full workflows with real databases
- Aim for 80%+ coverage
- Use pytest fixtures for common setup
- Mark integration tests:
@pytest.mark.integration - Test both sync and async code paths
- Test error conditions and edge cases
- SQLite: Always test (in-memory, fast, no setup)
- PostgreSQL: Test locally if making adapter changes
- MySQL/Oracle: Test in specialized environments or CI
- Update README.md for user-facing changes
- Update CHANGELOG.md following Keep a Changelog format
- Add examples in
examples/for new features - Keep CLAUDE.md updated for architecture changes
- Open a discussion on GitHub
- File an issue for bugs or feature requests
By contributing, you agree that your contributions will be licensed under the MIT License.