Hello! 👋
Thank you for considering contributing to superduper
. There are many ways to contribute, and they are not limited to writing code. We welcome all contributions such as:
- bug reports
- documentation improvements
- enhancement suggestions
- expanding the reusable-snippets and use-cases
This project is intended to be a community effort, and it won't be possible without your support and enthusiasm.
If you're new to open-source development, we recommend going through the GitHub “issues” tab to find items that interest you. Once you’ve found something interesting, the next step is to create your development environment.
Once you've 'forked' and 'cloned' the code to your local machine, please follow these steps:
Get the code on your local:
# Clone and change location directory of the superduper repository, change the `<FORKED_NAME>` to your GitHub id
git clone [email protected]:<FORKED_NAME>/superduper.git
cd superduper
Set up your python environment:
# Create your Python virtual environment
python3 -m venv .venv
# Activate the Python virtual environment
. .venv/bin/activate
Install the dependencies:
# Install pip-tools and latest version of pip
pip install --upgrade pip-tools
# Install the SuperDuper project in editable mode, along with the necessary developer tools.
pip install -e '.[test]'
Install the required plugins for your development environment.
# The mongodb plugin is required for the tests (nosql)
pip install -e 'plugins/mongodb[test]'
# The ibis and sqlalchemy plugins are required for the tests (sql)
pip install -e 'plugins/ibis[test]'
pip install -e 'plugins/sqlalchemy[test]'
You can install any additional plugins needed for your development environment.
We follow something called a "fork and pull request" workflow for collaborating on our project. See here for a great overview on what some of these mysterious terms mean!
These tests check that there are no basic programming errors in how classes and functions work internally.
make unit_testing
We use specific use cases to test the entire system.
make usecase_testing
We maintain a set of plugins that are tested independently.. If you change the plugin code, you can run the tests for that plugin.
export PYTHONPATH=./
# Install the plugin you want to test
pip install -e 'plugins/<PLUGIN_NAME>[test]'
# Run the tests
pytest plugins/<PLUGIN_NAME>/plugin_test
We use black
for code formatting, run
for linting, and mypy
for type-checking.
You can run the following commands to check the code:
make lint-and-type-check
If you want to format the code, you can run the following command:
make fix-and-check
The superduper
project is designed to be extensible and customizable. You can create new plugins and templates to extend the functionality of the project.
Plugins are Python packages that extend the functionality of the SuperDuper project. More details about the plugins can be found in the documentation:
If you want to create a new plugin, you can follow the steps below:
- Copy
plugins/template
toplugins/<PLUGIN_NAME>
- Modify the name of the plugin in the following names:
- Plugin name in
pyproject.toml
- Package name
superduper_<PLUGIN_NAME>
- Plugin name in
- Write the code for the plugin
- Create the tests directory
plugin_test/
and write the tests - Modify the
__version__
in thesuperduper_<PLUGIN_NAME>/__init__.py
file. We use this version for releasing the plugin.
We follow x.y.z versioning for the plugins, where the x.y version matches the superduper x.y version.
We increment the z version for new releases and increment the x.y version for major releases.
Templates are reusable components that facilitate the quick and easy building of AI applications. More details about the templates can be found in the documentation:
If you want to create a new template, you can follow the steps below:
- Create a new directory in
templates/<TEMPLATE_NAME>
- Create a
build.ipynb
file with the code to build the template- Present the build process in a Jupyter notebook
- Package all the components into the application
- Build a template from the application
- Export the template using
template.export('.')
, and then you can getcomponent.json
in the directory
We maintain the documentation in the superduper-docs repository.
Please go to the repository and create a pull request with the changes you want to make.
git clone [email protected]:<FORKED_NAME>/superduper-docs.git
cd superduper-docs
For most document updates and additions, you can directly modify the files under superduper-docs/content
.
But there are some special cases:
- Plugin documentation
- Template documentation
Creating of updating documentation for a plugin
After you create or update a plugin, you need to update the documentation.
- Update the
README.md
file in the plugin directory. - Copy the file to the
superduper-docs/content/plugins
directory and change the file name to<PLUGIN_NAME>.md
.
Creating of updating documentation for a template
After you create or update a template, you need to update the documentation.
We can use the to_docusaurus_markdown.py
script to convert the Jupyter notebook to the markdown file.
python3 to_docusaurus_markdown.py <Your superduper project path>/templates/<TEMPLATE_NAME>/build.ipynb
Then a new markdown file <Your superduper project path>/templates/<TEMPLATE_NAME>/build.md
.
You can copy the file to the superduper-docs/content/templates
directory and change the file name to <TEMPLATE_NAME>.md
.
If you have an unsolvable problem or find a bug with the code, we would love it if you could create a useful issue on GitHub.
Creating a useful issue, is itself a useful skill. Think about following these pointers:
- Add the "bug label" to flag the issue as a bug
- Make sure the issue contains the minimal code needed to create the issue:
- Remove padding code, unnecessary setup etc.
- Make it as easy as possible to recreate the problem.
- Always include the traceback in the issue
- To flag the issue to the team, escalate this in the Slack channels
- Tag relevant people who have worked on that issue, or know the feature
We have two ci workflows that run on the pull requests:
- Code Testing: Unittests, Extension Integration Tests. The code testing is run on every pull request.
- Plugin Testing: Plugin tests. The plugin testing only runs on the pull requests that change the plugin code.
Additionally, we have a plugin release workflow that runs on the main branch. The plugin release workflow will release the plugins to the PyPI.
- Lint and type-check
- Unit Testing, will run the unittests with mongodb and sqlite
- Usecase Testing, will run the usecases with mongodb and sqlite
The plugin use matrix testing to test the plugins which are changed in the pull request.
- Lint and type-check
- Run
plugins/<PLUGIN_NAME>/plugin_test
- Run the base testing(Optional): If the config file
plugins/<PLUGIN_NAME>/plugin_test/config.yaml
exists, the unittests and usecases will be run with the plugin.
The workflow detects commit messages like [PLUGINS] Bump Version [plugin_1 | plugin_2]
and releases the corresponding plugins to PyPI.
If you have any problems please contact a maintainer or community volunteer. The GitHub issues or the Slack channel are a great place to start. We look forward to seeing you there! 💜