Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the project.
Be respectful, constructive, and professional in all interactions.
- Python 3.9+
- SQLite 3.41+
- Git
- Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/sqlite-vec-client.git
cd sqlite-vec-client- Install development dependencies:
pip install -r requirements-dev.txt- Install pre-commit hooks:
pre-commit installgit checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Write clean, readable code
- Follow existing code style
- Add tests for new features
- Update documentation as needed
# Run all tests
pytest
# Run with coverage
pytest --cov=sqlite_vec_client --cov-report=html
# Run specific test categories
pytest -m unit
pytest -m integration# Format code
ruff format .
# Lint code
ruff check .
# Type checking
mypy sqlite_vec_client/
# Run all checks
ruff check . && ruff format . && mypy sqlite_vec_client/ && pytestgit add .
git commit -m "feat: add new feature"
# or
git commit -m "fix: resolve bug"Commit message format:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test additions or changesrefactor:Code refactoringchore:Maintenance tasks
git push origin your-branch-nameThen create a pull request on GitHub.
- Tests pass locally
- Code is formatted (ruff format)
- No linting errors (ruff check)
- Type checking passes (mypy)
- Documentation is updated
- CHANGELOG.md is updated (if applicable)
Include:
- What changes were made
- Why the changes were needed
- How to test the changes
- Related issue numbers (if any)
- Place tests in the
tests/directory - Use descriptive test names:
test_<function>_<scenario>_<expected_result> - Use pytest fixtures from
conftest.py - Mark tests appropriately:
@pytest.mark.unitor@pytest.mark.integration
- Aim for 80%+ coverage
- Test edge cases and error conditions
- Include security tests for user inputs
- Follow PEP 8
- Use type hints
- Maximum line length: 88 characters (Black default)
- Use descriptive variable names
- Docstrings for all public functions/classes
- Use Google-style docstrings
- Include examples in docstrings when helpful
Example:
def add(self, texts: list[str], embeddings: list[list[float]]) -> list[int]:
"""Add texts with embeddings to the database.
Args:
texts: List of text strings to store.
embeddings: List of embedding vectors (one per text).
Returns:
List of rowids for the inserted records.
Raises:
VecClientError: If insertion fails.
"""Include:
- Python version
- SQLite version
- sqlite-vec version
- Minimal code to reproduce
- Expected vs actual behavior
- Error messages/stack traces
Include:
- Use case description
- Proposed API (if applicable)
- Why existing features don't solve the problem
sqlite-vec-client/
├── sqlite_vec_client/ # Main package
│ ├── __init__.py # Public API
│ ├── base.py # SQLiteVecClient class
│ ├── exceptions.py # Custom exceptions
│ ├── types.py # Type definitions
│ ├── utils.py # Utility functions
│ └── validation.py # Input validation
├── tests/ # Test suite
├── examples/ # Usage examples
└── docs/ # Documentation (future)
Check the TODO file for tasks. Good starting points:
- Documentation improvements
- Additional examples
- Test coverage improvements
- Bug fixes
- Performance optimizations
- Open an issue for questions
- Check existing issues and PRs first
- Be patient and respectful
By contributing, you agree that your contributions will be licensed under the MIT License.