Contributing to LongProbe¶
Thank you for your interest in contributing to LongProbe! This guide will help you get started.
Development Setup¶
1. Fork and Clone¶
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/LongProbe.git
cd LongProbe
2. Install Dependencies¶
3. Run Tests¶
# Run unit tests
uv run pytest tests/unit/ -v
# Run all tests including integration
uv run pytest tests/ -v --run-integration
# Run with coverage
uv run pytest --cov=longprobe --cov-report=html
4. Lint and Format¶
# Check code style
uv run ruff check src/
# Auto-fix issues
uv run ruff check --fix src/
# Format code
uv run ruff format src/
Making Changes¶
1. Create a Branch¶
2. Make Your Changes¶
- Write clear, concise code
- Add tests for new features
- Update documentation as needed
- Follow existing code style
3. Test Your Changes¶
# Run tests
uv run pytest tests/
# Check linting
uv run ruff check src/
# Format code
uv run ruff format src/
4. Commit Your Changes¶
Use conventional commit messages:
- feat: - New feature
- fix: - Bug fix
- docs: - Documentation changes
- test: - Test changes
- refactor: - Code refactoring
- chore: - Maintenance tasks
5. Push and Create PR¶
Then create a Pull Request on GitHub.
Code Style¶
We use Ruff for linting and formatting:
Testing Guidelines¶
Writing Tests¶
# tests/unit/test_feature.py
import pytest
from longprobe import LongProbe
def test_feature():
"""Test description."""
# Arrange
probe = LongProbe(...)
# Act
result = probe.some_method()
# Assert
assert result == expected
Running Specific Tests¶
# Run specific test file
uv run pytest tests/unit/test_scorer.py -v
# Run specific test
uv run pytest tests/unit/test_scorer.py::test_recall_calculation -v
# Run with markers
uv run pytest -m "not slow" -v
Documentation¶
Building Docs Locally¶
# Install docs dependencies
pip install mkdocs-material mkdocstrings[python]
# Serve docs locally
mkdocs serve
# Build docs
mkdocs build
Writing Documentation¶
- Use clear, simple language
- Include code examples
- Add links to related pages
- Test all code examples
Pull Request Process¶
- Update Documentation - If you add features, update docs
- Add Tests - New features need tests
- Pass CI - All tests must pass
- Code Review - Address reviewer feedback
- Squash Commits - Clean up commit history if needed
Release Process¶
(For maintainers)
- Update
CHANGELOG.md - Bump version in
pyproject.toml - Create git tag:
git tag v0.2.0 - Push tag:
git push origin v0.2.0 - GitHub Actions will build and create release
Getting Help¶
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions
Code of Conduct¶
Be respectful and inclusive. We're all here to build great tools together.
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.