We welcome contributions to GraphFlow! This document provides guidelines for contributing to the project.
- Clone the repository:
git clone https://github.com/UnicoLab/GraphFlow.git
cd graphflow- Set up development environment:
python setup_dev.pyThis will:
- Install the package in development mode
- Install development dependencies
- Run code formatting and type checking
- Run the test suite
- Validate the project structure
We use the following tools for code quality:
- Black for code formatting
- isort for import sorting
- mypy for type checking
- pytest for testing
Run these tools before submitting:
# Format code
black graphflow/ tests/ examples/
# Sort imports
isort graphflow/ tests/ examples/ --profile black
# Type checking
mypy graphflow/ --ignore-missing-imports
# Run tests
pytest tests/ -v --cov=graphflowWe maintain comprehensive test coverage. When adding new features:
- Write tests first (TDD approach recommended)
- Test both happy path and edge cases
- Include integration tests for complex features
- Maintain >90% test coverage
Run tests:
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=graphflow --cov-report=html
# Run specific test file
pytest tests/test_core.py -v- Create an issue describing the feature
- Fork the repository and create a feature branch
- Implement the feature with tests
- Update documentation as needed
- Submit a pull request
When contributing to GraphFlow, please follow these architectural principles:
- Automatic parameter detection should be the default
- Manual specification should be available as an override
- Type hints should be used for better parameter resolution
- Pure functions are preferred when possible
- Side effects should be clearly documented
- Error handling should be robust and informative
- DAG validation must be maintained
- Dependency detection should be automatic where possible
- Execution order must respect dependencies
- Pluggable architecture for different backends
- Resource management should be handled properly
- Error recovery should be implemented
- Update documentation for any new features
- Add tests for new functionality
- Ensure all tests pass locally
- Update CHANGELOG.md with your changes
- Submit PR with clear description
- Code follows style guidelines (black, isort)
- Type hints are provided
- Tests are added/updated
- Documentation is updated
- All tests pass
- No breaking changes (or clearly documented)
graphflow/
├── core/ # Core framework components
│ ├── context.py # Context management system
│ ├── dataset.py # Dataset abstraction
│ ├── decorators.py # Node decorators
│ ├── pipeline.py # Pipeline engine
│ └── executors.py # Execution backends
├── cli/ # Command-line interface
├── patterns/ # Pre-built processing patterns
├── integrations/ # External system integrations
└── utils/ # Utility functions
tests/ # Test suite
examples/ # Usage examples
docs/ # Documentation
- Docstrings should follow Google style
- Type hints are required for public APIs
- Examples should be included in docstrings
- README should be updated for major features
- Update version in
pyproject.tomland__init__.py - Update CHANGELOG.md with release notes
- Create release tag following semantic versioning
- Publish to PyPI (maintainers only)
- GitHub Issues for bug reports and feature requests
- GitHub Discussions for questions and ideas
- Discord/Slack (links in README) for real-time chat
Please be respectful and inclusive in all interactions. We follow the standard open source code of conduct.
By contributing, you agree that your contributions will be licensed under the MIT License.