Skip to main content

Setup Development Environment

Follow the steps below to get CocoIndex built on the latest codebase locally - if you are making changes to CocoIndex functionality and want to test it out.

  • 🦀 Install Rust

    If you don't have Rust installed, run

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    Already have Rust? Make sure it's up to date

    rustup update
  • Setup Python virtual environment:

    python3 -m venv .venv

    Activate the virtual environment, before any installing / building / running:

    . .venv/bin/activate
  • Install required tools:

    pip install maturin
  • Build the library. Run at the root of cocoindex directory:

    maturin develop -E all,dev
  • Install and enable pre-commit hooks. This ensures all checks run automatically before each commit:

    pre-commit install
  • Before running a specific example, set extra environment variables, for exposing extra traces, allowing dev UI, etc.

    . ./.env.lib_debug