mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-14 00:57:23 +08:00
Some checks failed
gh-pages / build (push) Has been cancelled
Python CI / python-ci (ubuntu-latest, 3.10) (push) Has been cancelled
Python CI / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python CI / python-ci (windows-latest, 3.10) (push) Has been cancelled
Python CI / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.10) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.10) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.10) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.10) (push) Has been cancelled
Python Publish (pypi) / Upload release to PyPI (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.10) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.10) (push) Has been cancelled
Spellcheck / spellcheck (push) Has been cancelled
* Add deprecation warnings for fnllm and multi-search * Fix dangling token_encoder refs * Fix local_search notebook * Fix global search dynamic notebook * Fix global search notebook * Fix drift notebook * Switch example notebooks to use LiteLLM config * Properly annotate dev deps as a group * Semver * Remove --extra dev * Remove llm_model variable * Ignore ruff ASYNC240 * Add note about expected broken notebook in docs * Fix custom vector store notebook * Push tokenizer throughout
76 lines
2.8 KiB
Markdown
76 lines
2.8 KiB
Markdown
# Development Guide
|
|
|
|
# Requirements
|
|
|
|
| Name | Installation | Purpose |
|
|
| ------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
|
|
| Python 3.10-3.12 | [Download](https://www.python.org/downloads/) | The library is Python-based. |
|
|
| uv | [Instructions](https://docs.astral.sh/uv/) | uv is used for package management and virtualenv management in Python codebases |
|
|
|
|
# Getting Started
|
|
|
|
## Install Dependencies
|
|
|
|
```sh
|
|
# install python dependencies
|
|
uv sync
|
|
```
|
|
|
|
## Execute the Indexing Engine
|
|
|
|
```sh
|
|
uv run poe index <...args>
|
|
```
|
|
|
|
## Executing Queries
|
|
|
|
```sh
|
|
uv run poe query <...args>
|
|
```
|
|
|
|
# Azurite
|
|
|
|
Some unit and smoke tests use Azurite to emulate Azure resources. This can be started by running:
|
|
|
|
```sh
|
|
./scripts/start-azurite.sh
|
|
```
|
|
|
|
or by simply running `azurite` in the terminal if already installed globally. See the [Azurite documentation](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite) for more information about how to install and use Azurite.
|
|
|
|
# Lifecycle Scripts
|
|
|
|
Our Python package utilize uv to manage dependencies and [poethepoet](https://pypi.org/project/poethepoet/) to manage build scripts.
|
|
|
|
Available scripts are:
|
|
|
|
- `uv run poe index` - Run the Indexing CLI
|
|
- `uv run poe query` - Run the Query CLI
|
|
- `uv build` - This will build a wheel file and other distributable artifacts.
|
|
- `uv run poe test` - This will execute all tests.
|
|
- `uv run poe test_unit` - This will execute unit tests.
|
|
- `uv run poe test_integration` - This will execute integration tests.
|
|
- `uv run poe test_smoke` - This will execute smoke tests.
|
|
- `uv run poe test_verbs` - This will execute tests of the basic workflows.
|
|
- `uv run poe check` - This will perform a suite of static checks across the package, including:
|
|
- formatting
|
|
- documentation formatting
|
|
- linting
|
|
- security patterns
|
|
- type-checking
|
|
- `uv run poe fix` - This will apply any available auto-fixes to the package. Usually this is just formatting fixes.
|
|
- `uv run poe fix_unsafe` - This will apply any available auto-fixes to the package, including those that may be unsafe.
|
|
- `uv run poe format` - Explicitly run the formatter across the package.
|
|
|
|
## Troubleshooting
|
|
|
|
### "RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config" when running uv install
|
|
|
|
Make sure llvm-9 and llvm-9-dev are installed:
|
|
|
|
`sudo apt-get install llvm-9 llvm-9-dev`
|
|
|
|
and then in your bashrc, add
|
|
|
|
`export LLVM_CONFIG=/usr/bin/llvm-config-9`
|