Thank you for your interest in contributing to pynumaflow! This guide will help you get started.
- Python 3.10 or higher
- uv for dependency management
- Git
# Clone the repository
git clone https://github.com/numaproj/numaflow-python.git
cd numaflow-python/packages/pynumaflow
# Install dependencies
make setupThis will install all development dependencies including testing and linting tools.
# Run tests
make test
# Run linting
make lintWe use Black for code formatting and Ruff for linting.
make formatmake lintWe recommend setting up pre-commit hooks to automatically format and lint code before commits:
pre-commit installmake testuv run pytest tests/test_mapper.py -vuv run pytest tests/ --cov=pynumaflow --cov-report=htmlpackages/pynumaflow/
βββ pynumaflow/ # Main package
β βββ mapper/ # Map UDF implementation
β βββ reducer/ # Reduce UDF implementation
β βββ mapstreamer/ # MapStream implementation
β βββ batchmapper/ # BatchMap implementation
β βββ sourcer/ # Source implementation
β βββ sinker/ # Sink implementation
β βββ sourcetransformer/# SourceTransform implementation
β βββ sideinput/ # SideInput implementation
β βββ reducestreamer/ # ReduceStream implementation
β βββ accumulator/ # Accumulator implementation
β βββ proto/ # Protocol buffer definitions
β βββ shared/ # Shared utilities
β βββ types.py # Common type definitions
βββ tests/ # Test files
βββ examples/ # Example implementations
βββ docs/ # Documentation source
βββ pyproject.toml # Project configuration
βββ Makefile # Development commands
git checkout -b feature/your-feature-name- Write clear, documented code
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
make test
make lintWrite clear commit messages:
git commit -m "Add feature: description of your change"git push origin feature/your-feature-nameThen create a Pull Request on GitHub.
If you need to modify protocol buffer definitions:
- Edit the
.protofiles inpynumaflow/proto/ - Regenerate Python files:
make proto# Install all dependencies (including docs)
make setup
# Serve locally
make docs-serveVisit http://localhost:8000 to preview.
- Documentation source files are in
docs/ - Use Markdown with MkDocs extensions
- Include code examples
- Keep explanations clear and concise
- Tests pass (
make test) - Code is formatted (
make lint) - Documentation is updated (if applicable)
- Commit messages are clear
Include:
- What the change does
- Why the change is needed
- How to test the change
- Any breaking changes
- A maintainer will review your PR
- Address any feedback
- Once approved, your PR will be merged
Include:
- Python version
- pynumaflow version
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages (if any)
Include:
- Use case description
- Proposed solution
- Alternatives considered
Please be respectful and constructive in all interactions. We're all here to build great software together.
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.