Contributing¶
Guidelines for contributing to Metaseed.
Development Setup¶
-
Clone the repository:
-
Install dependencies and pre-commit hooks:
Development Workflow¶
Running Tests¶
# Run all tests
make test
# Run with coverage
make test-cov
# Run specific test file
uv run pytest tests/test_version.py
Code Quality¶
Pre-commit hooks run automatically on commit. To run manually:
# Run all hooks
uv run pre-commit run --all-files
# Run ruff linter only
make lint
# Format code
make format
Documentation¶
Code Style¶
- Follow PEP 8 conventions
- Use Google style docstrings
- Maximum line length: 100 characters
- Use type hints for all function signatures
Commit Messages¶
- Use present tense ("add feature" not "added feature")
- Keep the first line under 72 characters
- Reference issues where applicable
Pull Requests¶
- Create a feature branch from
main - Make your changes with tests
- Ensure all tests pass
- Update documentation if needed
- Submit a pull request
Project Structure¶
metaseed/
├── src/metaseed/ # Main package
│ ├── api/ # FastAPI routes
│ ├── cli/ # Typer commands
│ ├── core/ # Shared utilities
│ ├── models/ # Pydantic models
│ ├── specs/ # YAML schemas
│ ├── storage/ # Persistence
│ └── validators/ # Validation logic
├── tests/ # Test suite
└── docs/ # Documentation
Exception Handling¶
Metaseed uses two exception hierarchies. Use the correct one based on where your code lives.
| Layer | Base Class | Module | When to Use |
|---|---|---|---|
| Internal | MiappeError |
core/exceptions.py |
Code in core/, models/, specs/, storage/ |
| Public API | MetaseedError |
api/errors.py |
Code in api/, user-facing errors |
Internal exceptions are caught at the API boundary and translated to public exceptions. See Exception Architecture for details.