How to set up Graphite for development
This document shows how you can set up Graphite project for development tasks.
Step 1: Fork repository
If you want to contribute to Graphite, you should create a fork first:
Step 2: Clone repository
- Install Git.
- Open terminal in the directory you want to keep project in.
- Clone git repository: (Replace
user-name/graphitewith correct path to your fork)
git clone https://github.com/user-name/graphite.git
Note:
You need a GitHub account to contribute in Graphite.
Step 3: Install dependencies
- Install Python. (Works on
3.9to3.14) - Open terminal in project directory.
- Install required Python packages:
pip install -r requirements.txt
- Install
buildpackage if you need to build Graphite:
pip install build
Tips
Creating separated branches
Always create an up-to-date branch when you need to work on a feature or bug fix.
- Open terminal in project directory.
- Update your fork's
devbranch. - Checkout
devbranch:
git checkout dev
- Create a new branch: (Replace
<new-branch-name>with your branch name (without<>))
git checkout -b <new-branch-name>
- Start editing.
Running checks
Always run checks before push to development branches.
Pylint
- Open terminal in project directory.
- Install
pylint:
pip install pylint
- Lint code with pylint:
pylint $(git ls-files '*.py')
- Ensure your code gives 10.00/10 rating.
Pytest
- Open terminal in project directory.
- Install
pytest:
pip install pytest
- Run unit tests:
cd ./tests
pytest
- Ensure all tests pass without problem.