Contributing to Prela¶
Thank you for your interest in contributing to Prela! This guide will help you get started.
Development Setup¶
Prerequisites¶
- Python 3.9+
- Git
- pip and virtualenv
Clone the Repository¶
Setup Development Environment¶
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -e ".[dev,all]"
Run Tests¶
# Run all tests
pytest
# Run with coverage
pytest --cov=prela --cov-report=html
# Run specific test file
pytest tests/test_span.py
# Run specific test
pytest tests/test_span.py::test_span_creation
Code Quality¶
Formatting¶
We use black for code formatting:
Linting¶
We use ruff for linting:
Type Checking¶
We use mypy for type checking:
Making Changes¶
Create a Branch¶
Commit Guidelines¶
Use conventional commit messages:
feat: add support for custom exporters
fix: resolve context propagation in thread pools
docs: update installation guide
test: add tests for span serialization
refactor: simplify sampler interface
Write Tests¶
All new features and bug fixes should include tests:
# tests/test_your_feature.py
import pytest
from prela import Span, SpanType
def test_your_feature():
"""Test description."""
span = Span(name="test", span_type=SpanType.CUSTOM)
# Test assertions
assert span.name == "test"
Update Documentation¶
Update relevant documentation:
- API docstrings
- Usage examples
- README updates
- Migration guides (if breaking changes)
Pull Request Process¶
Before Submitting¶
- Run all tests:
pytest - Check coverage:
pytest --cov=prela - Format code:
black prela tests - Lint code:
ruff check prela tests - Type check:
mypy prela - Update CHANGELOG.md
Submitting PR¶
- Push your branch to GitHub
- Create a pull request
- Fill out the PR template
- Link related issues
- Request review
PR Checklist¶
- Tests pass
- Code coverage maintained/improved
- Documentation updated
- CHANGELOG.md updated
- Commit messages follow conventions
- Code formatted with black
- No linting errors
- Type hints added
Development Guidelines¶
Code Style¶
- Use type hints for all functions
- Write docstrings in Google style
- Keep functions focused and small
- Prefer composition over inheritance
Testing¶
- Aim for 100% test coverage
- Test edge cases
- Test error handling
- Use descriptive test names
Documentation¶
- Document all public APIs
- Include usage examples
- Keep docs up to date
- Use clear, concise language
Project Structure¶
prela-sdk/
├── prela/ # Source code
│ ├── core/ # Core tracing
│ ├── exporters/ # Export backends
│ ├── instrumentation/ # Auto-instrumentation
│ ├── evals/ # Evaluation framework
│ └── contrib/ # CLI and extras
├── tests/ # Test suite
├── examples/ # Example scripts
├── docs/ # Documentation
└── .github/ # GitHub workflows
Release Process¶
Maintainers will handle releases. Process:
- Update version in
_version.py - Update CHANGELOG.md
- Create git tag
- Build package:
python -m build - Publish to PyPI:
twine upload dist/*
Getting Help¶
Code of Conduct¶
Our Standards¶
- Be respectful and inclusive
- Welcome newcomers
- Accept constructive criticism
- Focus on what's best for the community
Unacceptable Behavior¶
- Harassment or discrimination
- Trolling or insulting comments
- Personal or political attacks
- Publishing others' private information
Enforcement¶
Violations may result in temporary or permanent ban from project participation.
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Recognition¶
Contributors will be recognized in:
- CONTRIBUTORS.md
- Release notes
- Documentation credits
Thank You!¶
Your contributions make Prela better for everyone. Thank you for being part of our community!