Contributing to aipartnerupflow¶
Thank you for your interest in contributing to aipartnerupflow! This document provides guidelines and instructions for contributing.
Code of Conduct¶
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Respect different viewpoints and experiences
How to Contribute¶
Reporting Bugs¶
- Check existing issues: Search GitHub Issues to see if the bug is already reported
- Create a new issue: If not found, create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Python version, OS, etc.)
- Error messages or logs
Suggesting Features¶
- Check existing discussions: Search GitHub Discussions
- Create a feature request: Include:
- Use case and motivation
- Proposed solution
- Alternatives considered
- Impact on existing code
Contributing Code¶
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Write/update tests
- Ensure all tests pass:
pytest - Update documentation if needed
- Commit your changes: Follow commit message guidelines
- Push to your fork:
git push origin feature/my-feature - Create a Pull Request
Development Setup¶
See DEVELOPMENT.md for detailed setup instructions.
Quick Setup:
# Clone your fork
git clone https://github.com/YOUR_USERNAME/aipartnerupflow.git
cd aipartnerupflow
# Create virtual environment
python3.10+ -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
pip install -e ".[all,dev]"
# Run tests
pytest
Code Style¶
Python Code¶
We use: - Black for code formatting (line length: 100) - Ruff for linting - mypy for type checking (optional, not strict)
Format code:
Configuration: See pyproject.toml for tool settings.
Code Style Guidelines¶
-
Type Hints: Use type hints for function parameters and return values
-
Docstrings: Use Google-style docstrings
-
Naming Conventions:
- Classes:
PascalCase - Functions/Methods:
snake_case - Constants:
UPPER_SNAKE_CASE -
Private: Prefix with
_ -
Imports: Organize imports:
Testing¶
Running Tests¶
# Run all tests
pytest
# Run with coverage
pytest --cov=src/aipartnerupflow --cov-report=html
# Run specific test file
pytest tests/core/execution/test_task_manager.py
# Run with verbose output
pytest -v
Writing Tests¶
- Test files: Place in
tests/directory, mirroring source structure - Test functions: Prefix with
test_ - Use fixtures: See
tests/conftest.pyfor available fixtures - Async tests: Use
@pytest.mark.asynciofor async functions
Example:
import pytest
from aipartnerupflow import TaskManager, create_session
@pytest.mark.asyncio
async def test_task_creation():
"""Test task creation"""
db = create_session()
task_manager = TaskManager(db)
task = await task_manager.task_repository.create_task(
name="test_task",
user_id="test_user"
)
assert task.id is not None
assert task.name == "test_task"
Test Coverage¶
- Aim for high test coverage (>80%)
- Focus on critical paths and edge cases
- Test both success and failure scenarios
Commit Messages¶
Follow Conventional Commits format:
Types: - feat: New feature - fix: Bug fix - docs: Documentation changes - style: Code style changes (formatting, etc.) - refactor: Code refactoring - test: Test additions/changes - chore: Maintenance tasks
Examples:
feat(api): Add task cancellation endpoint
Add POST /tasks/cancel endpoint to support task cancellation.
Includes cancellation status tracking and cleanup.
Closes #123
fix(executor): Handle None inputs gracefully
Previously, None inputs would cause AttributeError.
Now returns empty dict as default.
Fixes #456
Pull Request Process¶
Before Submitting¶
- Update CHANGELOG.md: Add entry under
[Unreleased] - Update documentation: If adding features
- Run tests: Ensure all tests pass
- Check code style: Run
blackandruff - Update type hints: If changing function signatures
PR Description Template¶
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tests added/updated
- [ ] All tests pass
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
- [ ] Tests added/updated
- [ ] No breaking changes (or documented)
Review Process¶
- Automated checks: CI will run tests and linting
- Code review: Maintainers will review your PR
- Address feedback: Make requested changes
- Merge: Once approved, maintainers will merge
Project Structure¶
aipartnerupflow/
├── src/aipartnerupflow/ # Source code
│ ├── core/ # Core framework
│ ├── extensions/ # Extensions (crewai, stdio, etc.)
│ ├── api/ # API server
│ └── cli/ # CLI tools
├── tests/ # Test suite
├── docs/ # Documentation
└── scripts/ # Utility scripts
See DIRECTORY_STRUCTURE.md for details.
Areas for Contribution¶
High Priority¶
- Documentation: Improve examples, tutorials, API docs
- Tests: Increase test coverage, add integration tests
- Examples: Add more practical examples
- Error Messages: Improve error messages and debugging info
Feature Areas¶
- New Executors: Create executors for different use cases
- Storage Backends: Add support for more databases
- Monitoring: Add observability and monitoring features
- Performance: Optimize task execution and storage
Good First Issues¶
Look for issues tagged with good-first-issue on GitHub.
Questions?¶
- Documentation: Check docs/
- Discussions: GitHub Discussions
- Issues: GitHub Issues
License¶
By contributing, you agree that your contributions will be licensed under the Apache-2.0 license.
Recognition¶
Contributors will be: - Listed in CONTRIBUTORS.md (if we create one) - Acknowledged in release notes for significant contributions - Thanked in the project README
Thank you for contributing to aipartnerupflow! 🎉