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:

Fork Graphite from this link

Step 2: Clone repository

  • Install Git.
  • Open terminal in the directory you want to keep project in.
  • Clone git repository: (Replace user-name/graphite with 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.9 to 3.14)
  • Open terminal in project directory.
  • Install required Python packages:
pip install -r requirements.txt
  • Install build package 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.

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.