Contributing to SpiderChef
Thank you for your interest in contributing to SpiderChef! This guide explains how to get started with contributing to the project.
Development Setup
Prerequisites
- Python 3.10 or higher
- Git
Setting Up Your Development Environment
- Fork the repository on GitHub
-
Clone your fork locally:
-
Set up a virtual environment:
-
Install development dependencies:
-
Set up pre-commit hooks:
Development Workflow
Running Tests
SpiderChef uses pytest for testing:
Code Style
SpiderChef uses Ruff for code formatting and linting:
Type Checking
SpiderChef uses Pyright for type checking:
Pull Request Guidelines
-
Create a new branch for your feature or bugfix:
-
Make your changes and commit them with descriptive commit messages.
-
Update tests to cover your changes.
-
Update documentation if necessary.
-
Push your branch to your fork:
-
Open a pull request against the main repository.
Adding New Features
Adding a New Step Type
- Create a new step class in the appropriate module under
spiderchef/steps/. - Extend either
SyncSteporAsyncStepdepending on the nature of your step. - Implement the
_executemethod. - Register your step in
spiderchef/steps/__init__.py. - Add tests for your new step.
- Update documentation.
Example:
from spiderchef import SyncStep, Recipe
from typing import Any
class MyNewStep(SyncStep):
my_param: str
optional_param: int = 10
def _execute(self, recipe: Recipe, previous_output: Any = None) -> Any:
# Implement step logic here
return f"{self.my_param} processed with {self.optional_param}"
Improving Existing Features
When improving existing features:
- Maintain backward compatibility when possible.
- Add tests for the new functionality.
- Update documentation to reflect changes.
Documentation
SpiderChef uses MkDocs with the Material theme for documentation:
- Documentation source is in the
docs/directory. - To build and preview documentation locally:
- Open http://127.0.0.1:8000/ in your browser to preview the docs.
Release Process
- Create a new release on GitHub
- The CI pipeline will automatically publish to PyPI + bump the version
Getting Help
If you need help or have questions about contributing:
- Open an issue on GitHub
- Refer to the existing documentation
- Contact the maintainers
Code of Conduct
Please be respectful and considerate of others when contributing to SpiderChef. We strive to maintain a welcoming and inclusive community.