This document is for developers interested in contributing to GraphRAG.
Development is best done in a unix environment (Linux, Mac, or Windows WSL).
- Clone the GraphRAG repository.
- Follow all directions in the deployment guide to install required tools and deploy an instance of the GraphRAG service in Azure. Alternatively, this repo provides a devcontainer with all tools preinstalled.
- New unit tests and integration tests are currently being added to improve the developer experience when testing code changes locally.
A small collection of unit tests and integrations tests have been written to test functionality of the API. To get started, first ensure that all test dependencies have been installed.
cd <graphrag-accelerator-repo>/backend
poetry install --with test
Some tests require the azurite emulator and cosmosdb emulator to be running locally (these are setup in the ci/cd automatically). You may start these emulators by running them in the background as docker containers.
docker run -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite:latest
docker run -d -p 8081:8081 -p 1234:1234 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
To run the tests:
cd <graphrag-accelerator-repo>/backend
pytest -s --cov=src tests
This repository uses Github Actions for continuous integration and continious deployment (CI/CD).
-
We follow PEP 8 standards and naming conventions as close as possible.
-
ruff is used for linting and code formatting. A pre-commit hook has been setup to automatically apply settings to this repo. To make use of this tool without explicitly calling it, install the pre-commit hook.
> pre-commit install
We use SemVer for semantic versioning.