How to Contribute 💜
Since you landed on this part of the documentation, we want to first of all say thank you! 💜 Contributions from the community are essential to improving pruna, we appreciate your effort in making the repository better for everyone!
Please make sure to review and adhere to the Pruna Code of Conduct before contributing to Pruna. Any violations will be handled accordingly and result in a ban from the Pruna community and associated platforms. Contributions that do not adhere to the code of conduct will be ignored.
There are various ways you can contribute:
Have a question? Discuss with us on Discord or check out the FAQ
Have an idea for a new tutorial? Open an issue with a Feature Request or chat with us on Discord
Found a bug? Open an issue with a Bug Report
Want a new feature? Open an issue with a Feature Request
Have a new algorithm to add? Check out: Adding an Algorithm
Have a new metric to add? Check out: Adding a Metric
Have a new dataset to add? Check out: Adding a Dataset
Setup
If you want to contribute to pruna with a Pull Request, you can do so by following these steps. If it is your very first time contributing to an open source project, we recommend to start with this guide for some generally helpful tips.
1. Clone the repository
First, fork the repository by navigating to the original pruna repository on GitHub and click the Fork button at the top-right. This creates a copy of the repository in your own GitHub account. Then, clone the forked repository from your account to your local machine and change into its directory:
git clone https://github.com/your_username/pruna.git
cd pruna
To keep your fork up to date with the original repository, add the upstream remote:
git remote add upstream https://github.com/PrunaAI/pruna.git
Always work on a new branch rather than the main branch. You can create a new branch for your feature or fix:
git checkout -b feat/new-feature
2. Installation
You can now set up a virtual environment of your choice and install the dependencies by running the following command:
pip install -e .
pip install -e .[dev]
pip install -e .[tests]
You can then also install the pre-commit hooks with
pre-commit install
3. Develop your contribution
You are now ready to work on your contribution. Check out a branch on your forked repository and start coding! When committing your changes, we recommend to follow the Conventional Commit Guidelines.
git checkout -b feat/new-feature
git add .
git commit -m "feat: new amazing feature setup"
git push origin feat/new-feature
Make sure to develop your contribution in a way that is well documented, concise and easy to maintain. We will do our best to have your contribution integrated and maintained into pruna but reserve the right to reject contributions that we do not feel are in the best interest of the project.
4. Run the tests
We have a comprehensive test suite that is designed to catch potential issues before they are merged into pruna. When you make a contribution, it is highly recommended to not only run the existing tests but also to add new tests that cover your contribution.
You can run the tests by running the following command:
pytest
If you want to run only the tests with a specific marker, e.g. fast CPU tests, you can do so by running:
pytest -m "cpu and not slow"
5. Create a Pull Request
Once you have made your changes and tested them, you can create a Pull Request. We will then review your Pull Request and get back to you as soon as possible. If there are any questions along the way, please do not hesitate to reach out on Discord.