Contributing to Purpose
We love your input! We want to make contributing to Purpose as easy and transparent as possible, whether it’s:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
Development Process
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.
- Fork the repo and create your branch from
main. - If you’ve added code that should be tested, add tests.
- If you’ve changed APIs, update the documentation.
- Ensure the test suite passes.
- Make sure your code lints.
- Issue that pull request!
Pull Request Process
- Update the README.md with details of changes to the interface, if applicable.
- Update the documentation with any new features or changes.
- The PR will be merged once you have the sign-off of at least one other developer.
Any Contributions You Make Will Be Under the Software License
In short, when you submit code changes, your submissions are understood to be under the same LICENSE that covers the project. Feel free to contact the maintainers if that’s a concern.
Report Bugs Using GitHub’s Issue Tracker
We use GitHub issues to track public bugs. Report a bug by opening a new issue; it’s that easy!
Write Bug Reports with Detail, Background, and Sample Code
Great Bug Reports tend to have:
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn’t work)
Use a Consistent Coding Style
- 4 spaces for indentation rather than tabs
- 80 character line length
- Run
blackfor Python code formatting - Follow PEP 8 guidelines
License
By contributing, you agree that your contributions will be licensed under its MIT License.
References
This document was adapted from the open-source contribution guidelines for Facebook’s Draft.
Development Setup
- Clone the repository:
1 2
git clone https://github.com/yourusername/purpose.git cd purpose - Create a virtual environment:
1 2
python -m venv .venv source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
- Install development dependencies:
1
pip install -r requirements-dev.txt
- Install pre-commit hooks:
1
pre-commit install
Running Tests
1
pytest tests/
Code Quality Checks
Before submitting a PR, please run:
1
2
3
4
5
6
7
8
9
10
11
# Format code
black .
# Check style
flake8
# Type checking
mypy .
# Run tests
pytest
Documentation
We use Jekyll for our documentation. To preview documentation locally:
- Install Ruby and Bundler
- Run:
1 2 3
cd docs bundle install bundle exec jekyll serve
Getting Help
If you need help with contributing:
- Check the documentation
- Join our community discussions
- Ask questions in GitHub issues
- Contact the maintainers
Thank you for contributing to Purpose!