Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 2.38 KB

DEVELOPMENT-GUIDE.md

File metadata and controls

47 lines (33 loc) · 2.38 KB

Development Guide

This document is for developers interested in contributing to GraphRAG.

Quickstart

Development is best done in a unix environment (Linux, Mac, or Windows WSL).

  1. Clone the GraphRAG repository.
  2. 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.
  3. New unit tests and integration tests are currently being added to improve the developer experience when testing code changes locally.

Testing

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

Deployment (CI/CD)

This repository uses Github Actions for continuous integration and continious deployment (CI/CD).

Style Guide:

  • 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
    

Versioning

We use SemVer for semantic versioning.