Contributing to Krewlyzer
Thank you for your interest in contributing to Krewlyzer! This guide will help you get started.
Development Setup
Prerequisites
Clone and Install
git clone https://github.com/msk-access/krewlyzer.git
cd krewlyzer
# Create virtual environment
uv venv .venv
source .venv/bin/activate
# Install with dev dependencies
uv pip install -e ".[dev,test]"
# Verify installation
python -c "from krewlyzer import _core; print('Rust core:', _core.version())"
Code Style
Python
We use Ruff for linting and formatting:
# Format
ruff format src/ tests/
# Lint
ruff check src/ tests/
# Auto-fix
ruff check --fix src/ tests/
Rust
We use cargo fmt and cargo clippy:
Running Tests
All Tests
With Coverage
Specific Test File
Real Data Tests
Tests in tests/integration/test_real_data.py use fixtures in tests/data/fixtures/:
Making Changes
Workflow
- Fork the repository
- Create a branch:
git checkout -b feature/my-feature - Make changes and add tests
- Run tests:
pytest - Format code:
ruff format src/ tests/ - Commit: Use conventional commits (e.g.,
feat:,fix:,docs:) - Push and open a Pull Request
Commit Messages
Follow Conventional Commits:
feat: add new FSR output column
fix: resolve GC correction edge case
docs: update WPS usage example
test: add integration test for mFSD
refactor: consolidate PON loading logic
Rust Development
Building the Extension
Adding a New Function
- Create or edit a module in
rust/src/ - Export via PyO3 in
rust/src/lib.rs - Test from Python:
Debugging Rust
Documentation
Local Preview
Adding a Page
- Create
.mdfile indocs/ - Add to
mkdocs.ymlnav section - Verify build:
mkdocs build --strict
Pull Request Guidelines
- One feature per PR - Keep changes focused
- Include tests - All new features need tests
- Update docs - Add/update documentation as needed
- Pass CI - All checks must pass
- Describe changes - Clear PR description with context
CI Checks
- Python linting (Ruff)
- Unit and integration tests (pytest)
- Rust build (maturin)
- Docker build
- MkDocs build
Getting Help
- Issues: GitHub Issues
- Discussions: GitHub Discussions
License
By contributing, you agree that your contributions will be licensed under the AGPL-3.0 license.