Contributing to Manas
Thank you for your interest in contributing to Manas! This guide will help you get started with contributing to the project.
Development Setup
Prerequisites
- Python 3.11 or newer
- Poetry (for dependency management)
- Git
- A compatible IDE (we recommend VS Code with Python extensions)
Setting Up Your Development Environment
- Fork and Clone
1 2
git clone https://github.com/yourusername/manas.git cd manas
- Install Dependencies
1 2 3 4 5 6 7 8
# Install Poetry if you haven't already curl -sSL https://install.python-poetry.org | python3 - # Install project dependencies poetry install # Install development extras poetry install --extras "test docs"
- Set Up Pre-commit Hooks
1 2
# Install pre-commit poetry run pre-commit install
Code Style Guidelines
We follow standard Python coding conventions with some specific requirements:
Python Style
- Follow PEP 8 guidelines
- Use type hints for all function parameters and return values
- Maximum line length is 88 characters (Black formatter default)
- Use docstrings for all public modules, functions, classes, and methods
Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from typing import List, Optional
def process_items(items: List[str], max_items: Optional[int] = None) -> List[str]:
"""Process a list of items with optional limit.
Args:
items: List of strings to process
max_items: Maximum number of items to process
Returns:
List of processed items
Raises:
ValueError: If max_items is negative
"""
if max_items is not None and max_items < 0:
raise ValueError("max_items cannot be negative")
return items[:max_items]
Documentation
- All new features must include documentation
- Update relevant examples when adding new functionality
- Include docstrings with type hints, parameters, returns, and raises sections
- Add examples for complex features
Testing
- Write unit tests for all new features
- Include integration tests for complex functionality
- Ensure all tests pass before submitting a PR
- Maintain or improve code coverage
Example test:
1
2
3
4
5
6
7
8
9
10
11
import pytest
from core import LLM, Agent
async def test_agent_creation():
"""Test basic agent creation and functionality."""
model = LLM.from_provider("mock") # Use mock provider for testing
agent = Agent(llm=model)
response = await agent.generate("Test query")
assert isinstance(response, str)
assert len(response) > 0
Making Contributions
Types of Contributions
- Bug Fixes
- Identify bugs through issues
- Write failing test case
- Fix the bug
- Ensure all tests pass
- New Features
- Discuss new features in issues first
- Create detailed proposal if needed
- Implement feature with tests
- Update documentation
- Documentation
- Fix typos and unclear sections
- Add examples and tutorials
- Improve API documentation
- Update guides and FAQs
- Performance Improvements
- Profile the code
- Propose optimizations
- Include benchmarks
- Document improvements
Pull Request Process
- Create Feature Branch
1
git checkout -b feature/your-feature-name
- Make Changes
- Follow code style guidelines
- Add/update tests
- Update documentation
- Run linters and formatters
- Commit Changes
1 2 3 4 5 6 7
# Run pre-commit hooks poetry run pre-commit run --all-files # Commit with descriptive message git commit -m "feat: add new feature x Detailed description of changes"
- Open Pull Request
- Use PR template
- Link related issues
- Add description of changes
- Request review
CI/CD Pipeline
Our CI pipeline checks:
- Code Quality
- Black formatting
- isort import sorting
- Pylint linting
- Type checking with mypy
- Tests
- Unit tests
- Integration tests
- Coverage reports
- Documentation
- Build docs
- Link checking
- Example validation
Project Structure
1
2
3
4
5
6
7
8
9
10
11
manas/
├── core/ # Core framework code
│ ├── agent.py # Agent implementation
│ ├── flow.py # Flow orchestration
│ ├── llm.py # LLM interface
│ ├── rag.py # RAG implementation
│ └── ...
├── docs/ # Documentation
├── examples/ # Example code
├── tests/ # Test suite
└── tools/ # Development tools
Release Process
- Version Bump
- Update version in pyproject.toml
- Update CHANGELOG.md
- Create release notes
- Testing
- Run full test suite
- Perform integration testing
- Check documentation
- Release
- Create GitHub release
- Publish to PyPI
- Update documentation
Version Numbering
We follow Semantic Versioning:
- MAJOR version for incompatible API changes
- MINOR version for new functionality
- PATCH version for bug fixes
Getting Help
- Questions: Use GitHub Discussions
- Bugs: Open GitHub Issues
- Feature Requests: Open GitHub Issues
- Security Issues: See SECURITY.md
Code of Conduct
We follow a standard code of conduct to ensure a welcoming community. Key points:
- Be Respectful
- Use inclusive language
- Accept constructive criticism
- Focus on what’s best for the community
- Be Professional
- Keep discussions focused
- Avoid personal attacks
- Respect differing viewpoints
- Be Collaborative
- Help others learn
- Share knowledge
- Work together
Recognition
Contributors are recognized in several ways:
- Contributors List
- Added to AUTHORS.md
- Mentioned in release notes
- GitHub contributors page
- Special Recognition
- Significant contributions
- Long-term maintenance
- Documentation improvements
License
By contributing to Manas, you agree that your contributions will be licensed under the project’s MIT License.